
public class TestNull {
    int x;
    TestNull field;
    
    TestNull meth(TestNull tn) {

    	// parameter and return value tests
    	int y = this.x;
    	int z = tn.x;					// warn
    	TestNull result = this.meth(tn);
    	y = result.x;					// warn
    	result = tn.meth(this);			// warn
    	result = result.meth(tn);		// warn
    	
    	// field tests
    	y = field.x;				// warn

    	// definitely null tests
    	result = null;
    	TestNull copy = result;
    	result.meth(tn);				// error
    	y = result.x;					// error
    	y = copy.x;						// error
    	
    	// definitely not null tests
    	result = new TestNull();
    	result.meth(result);
    	z = result.x;
    	copy = result;
    	copy.meth(result);
    	z = copy.x;
    	
    	// array tests
    	TestNull arr[] = new TestNull[5];
    	result = arr[0];
    	y = arr[0].x;					// warn
    	arr = null;
    	result = arr[0];				// error
    	
    	return this;
    }
}
