abstract class RumorMill { abstract int countPeople(); } class EmptyMill extends RumorMill { EmptyMill() { } int countPeople() { return 0; } } class GossipMill extends RumorMill { String name; RumorMill next1; RumorMill next2; GossipMill(String name, RumorMill next1, RumorMill next2) { this.name = name; this.next1 = next1; this.next2 = next2; } int countPeople() { return 1 + this.next1.countPeople() + this.next2.countPeople(); } }