//5.6 /* +------------+ | FamilyTree |<--------------+ +------------+ | +------------+ | | | / \ | --- | | | --------------------- | | | | +-------------------+ +---------+ | | Person | | Unknown | | +-------------------+ +---------+ | | String name | +---------+ | | int year | | | FamilyTree mother |-+ | | FamilyTree father |-+ | +-------------------+ | | | | +-----------------+ */ // To describe a Family tree interface FamilyTree { } // To describe a person class Person implements FamilyTree { String name; int year; FamilyTree mother; FamilyTree father; Person(String name, int year, FamilyTree mother, FamilyTree father) { this.name = name; this.year = year; this.mother = mother; this.father = father; } } // To describe and Unknown person class Unknown implements FamilyTree { Unknown() { } } class Examples{ Examples(){} FamilyTree unknown = new Unknown(); Person claire = new Person("Claire", 1940, this.unknown, this.unknown); Person ray = new Person("Ray", 1939, this.unknown, this.unknown); Person emily = new Person("Emily", 1920, this.unknown, this.unknown); Person raphael = new Person("Raphael", 1917, this.unknown, this.unknown); Person debra = new Person("Debra", 1960, this.claire, this.ray); Person ralph = new Person("Ralph", 1958, this.emily, this.raphael); Person greg = new Person("Greg", 1989, this.debra, this.ralph); Person kenny = new Person("Kenny", 1992, this.debra, this.ralph); Person jeff = new Person("Jeff", 1996, this.debra, this.ralph); }