public class Bar { public void bar() { Foo f = new Foo(); f.method1(); } }