package test.of.newly; class Foo { Foo f; public Foo(Foo f) { this.f=f; } public Foo() { super(); } public void test() { return; } public void run() { //legeal call: newly crated object int hashCode= new Object().hashCode(); f.f=new Foo(); f.f.test(); } public static void main(String[] args) { System.out.println("***** A correct implementation should report no violation"); Foo aFoo = new Foo(new Foo(new Foo())); aFoo.run(); } }