class Foreign { } class Test { int field; void foo (Foreign f) { field++; } void bar () { foo(new Foreign()); } }