### Question:
HapsGenotypeWriter implements GenotypeWriter { @Override public void write(String basePath) throws IOException { write(new File(basePath + ".haps"), new File(basePath + ".sample")); } HapsGenotypeWriter(GenotypeData genotypeData); @Override void write(String basePath); void write(File hapsFile, File sampleFile); static final Charset FILE_ENCODING; static final char LINE_ENDING; }### Answer:
@Test public void write() throws IOException, URISyntaxException { writer.write(tmpOutputFolder.getAbsolutePath() + fileSep + "test"); GenotypeData genotypeDataWritten = RandomAccessGenotypeDataReaderFormats.SHAPEIT2.createGenotypeData(tmpOutputFolder.getAbsolutePath() + fileSep + "test", 0); assertTrue(GenotypeDataCompareTool.same(genotypeData, genotypeDataWritten)); assertEquals(genotypeData.getSamples().get(0).getMissingRate(), 0.25, 0.000001); assertEquals(genotypeData.getSamples().get(1).getMissingRate(), 0, 0.000001); assertEquals(genotypeData.getSamples().get(2).getMissingRate(), 0, 0.000001); assertEquals(genotypeData.getSamples().get(3).getMissingRate(), 0, 0.000001); assertEquals(genotypeData.getSamples().get(0).getAnnotationValues().get("bin1"), Boolean.TRUE); assertEquals(genotypeData.getSamples().get(1).getAnnotationValues().get("bin1"), Boolean.FALSE); assertEquals(genotypeData.getSamples().get(2).getAnnotationValues().get("bin1"), Boolean.TRUE); assertEquals(genotypeData.getSamples().get(3).getAnnotationValues().get("bin1"), Boolean.TRUE); genotypeData.close(); }