import p.Test; class Usage { Test myField; Test xxx(){ return myField; } Test xxxxx() { return null; } void bar(Test s) { s.foo(null); } }