class X { void f(){} } class JavaClass { public void setFoo(X value) { } public X getFoo() { return new X(); } }