
public class Person {

	String name;
	PersonList kids;
	
	public Person( String name, PersonList kids ) {
		this.name = name;
		this.kids = kids;
	}
	
	public int numDescendents() {
		return kids.totalNumber();
	}
	
	public static void main(String[] args) {
		Person Fred = new Person("Fred", new EmptyPL());
		Person Emily = new Person("Emily", new LargerPL(Fred, new EmptyPL()));
		Person George = new Person("George", new LargerPL( Emily, new EmptyPL()));
		
		System.out.println("Testing numDescendents: test 1");
		System.out.println(Fred.numDescendents() == 0);
		System.out.println(Emily.numDescendents());
		System.out.println(George.numDescendents());
		
	}

}

