### Question:
IdentityByDescentClustering { public List<IdentityByDescent> countIBD(List<Variant> variants, List<String> samples) { return countIBD(variants.iterator(), samples); } IdentityByDescentClustering();  IdentityByDescentClustering(IBDExpectedFrequencies ibdExpFreqs); List<IdentityByDescent> countIBD(List<Variant> variants, List<String> samples); List<IdentityByDescent> countIBD(Variant variant, List<String> samples); List<IdentityByDescent> countIBD(Iterator<Variant> iterator, List<String> samples); List<IdentityByDescent> countIBD(List<IdentityByState> identityByStates, IBDExpectedFrequencies expFreqs); IBDExpectedFrequencies getExpectedFrequencies(); IdentityByDescentClustering setExpectedFrequencies(IBDExpectedFrequencies expectedFrequencies); IdentityByStateClustering getIbsClustering(); IdentityByDescentClustering setIbsClustering(IdentityByStateClustering ibsClustering);  }### Answer:
@Test public void testIBD() throws IOException { String fileName = "ibs.vcf"; VariantFileMetadata fileMetadata = new VariantFileMetadata(fileName, "fid"); VariantStudyMetadata metadata = fileMetadata.toVariantStudyMetadata("sid"); VariantVcfReader variantReader = new VariantVcfReader(metadata, IdentityByStateClusteringTest.class.getClassLoader().getResource(fileName).getPath()); variantReader.open(); variantReader.pre(); List<Variant> variants = variantReader.read(50); variantReader.post(); variantReader.close(); IdentityByDescentClustering ibdc = new IdentityByDescentClustering(); List<String> samples = new ArrayList<>(variants.get(0).getStudy(metadata.getId()).getSamplesName()); List<IdentityByDescent> ibds = ibdc.countIBD(variants, samples); InputStream inputStream = IdentityByStateClusteringTest.class.getClassLoader().getResourceAsStream("ibs.genome"); BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream)); reader.readLine(); assertIBD(ibdc, ibds, reader); }