import java.util.*; class Child extends AncTree { String name; int yob; // year-of-birth String eye; // eye-color, e.g. "brown" AncTree ma, pa; // mother, father /** standard constructor */ public Child( String _name, int _yob, String _eye, AncTree _ma, AncTree _pa ) { // if (_ma == null) throw new NullPointerException(...); this.name = _name; this.yob = _yob; this.eye = _eye; this.ma = _ma; this.pa = _pa; } int size( /* Child this */ ) { return 1 + this.ma.size() + this.pa.size(); } java.util.List allNames( /* Child this */ ) { List theResult = new ArrayList(); theResult.addAll( this.ma.allNames() ); theResult.add( this.name ); theResult.addAll( this.pa.allNames() ); return Collections.unmodifiableList(theResult); } /** @Override */ public String toString( /* Child this */ ) { return "new Child" + "( " + this.name.toString() + ", " + this.yob + ", " + this.eye.toString() + ", " + this.ma.toString() + ", " + this.pa.toString() + " )"; } }