public void setMother(Person mor) { if (mor == null) { if (this.mother != null) { this.mother.children.remove(this); } this.mother = mor; } else if (mor.isFemale()) { if (this.mother != null) { this.mother.children.remove(this); } this.mother = mor; this.mother.children.add(this); } }