public void setFather(Person far) { if (far == null) { if (this.father != null) { this.father.children.remove(this); } this.father = far; } else if (far.isMale()) { if (this.father != null) { this.father.children.remove(this); } this.father = far; this.father.children.add(this); } }