Pedigree { public static Pedigree of(Collection<Individual> individuals) { return new Pedigree(individuals); } private  Pedigree(Collection<Individual> individuals); static Pedigree of(Collection<Individual> individuals); static Pedigree of(Individual... individuals); static Pedigree justProband(String id); static Pedigree empty(); @JsonIgnore boolean containsId(String id); @JsonIgnore Individual getIndividualById(String individualId); Set<Individual> getIndividuals(); @JsonIgnore Set<String> getIdentifiers(); @JsonIgnore int size(); @JsonIgnore boolean isEmpty(); @JsonIgnore int numFamilies(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }
@Test public void duplicateIndividualId() { Individual duplicatedId = Individual.builder().id(PROBAND.getId()).build(); assertThrows(IllegalArgumentException.class, () -> Pedigree.of(PROBAND, duplicatedId)); }
@Test public void illegalFatherId() { Individual noFather = Individual.builder().id("proband").fatherId("father").build(); assertThrows(IllegalArgumentException.class, () -> Pedigree.of(noFather)); }
@Test public void incorrectSexFather() { Individual incorrectSexFather = Individual.builder().id("father").sex(Sex.FEMALE).build(); assertThrows(IllegalArgumentException.class, () -> Pedigree.of(PROBAND, incorrectSexFather)); }
@Test public void incorrectSexMother() { Individual incorrectSexMother = Individual.builder().id("mother").sex(Sex.MALE).build(); assertThrows(IllegalArgumentException.class, () -> Pedigree.of(PROBAND, incorrectSexMother)); }