package com.example.foo; import com.example.bar.*; public class Foo extends Bar implements IFoo { private Baz baz; public Baz getBaz() { return baz; } public void setBaz(Baz baz) { this.baz = baz; } public synchronized String toString() { StringBuffer sb = new StringBuffer(); sb.append("Foo: \""); sb.append(baz.toString()); sb.append("\""); return sb.toString() } }