### Question:
BedBimFamGenotypeWriter implements GenotypeWriter { @Override public void write(String path) throws IOException, NotASnpException { write(new File(path + ".bed"), new File(path + ".bim"), new File(path + ".fam")); } BedBimFamGenotypeWriter(GenotypeData genotypeData); @Override void write(String path); void write(File bedFile, File bimFile, File famFile);  }### Answer:
@Test public void testWrite_String() throws Exception { GenotypeData genotypeData = new BedBimFamGenotypeData(getTestBed6(), getTestBim6(), getTestFam6(), 0); BedBimFamGenotypeWriter writer = new BedBimFamGenotypeWriter(genotypeData); writer.write(tmpOutputFolder.getAbsolutePath() + fileSep + "test6samples"); GenotypeData genotypeDataWritten = RandomAccessGenotypeDataReaderFormats.PLINK_BED.createGenotypeData(tmpOutputFolder.getAbsolutePath() + fileSep + "test6samples", 0); assertTrue(GenotypeDataCompareTool.same(genotypeData, genotypeDataWritten)); }
@Test public void testWrite_String2() throws Exception { GenotypeData genotypeData = new BedBimFamGenotypeData(getTestBed7(), getTestBim7(), getTestFam7(), 0); BedBimFamGenotypeWriter writer = new BedBimFamGenotypeWriter(genotypeData); writer.write(tmpOutputFolder.getAbsolutePath() + fileSep + "test7samples"); GenotypeData genotypeDataWritten = RandomAccessGenotypeDataReaderFormats.PLINK_BED.createGenotypeData(tmpOutputFolder.getAbsolutePath() + fileSep + "test7samples", 0); assertTrue(GenotypeDataCompareTool.same(genotypeData, genotypeDataWritten)); }
@Test public void testWrite_String3() throws Exception { GenotypeData genotypeData = new BedBimFamGenotypeData(getTestBed8(), getTestBim8(), getTestFam8(), 0); BedBimFamGenotypeWriter writer = new BedBimFamGenotypeWriter(genotypeData); writer.write(tmpOutputFolder.getAbsolutePath() + fileSep + "test8samples"); GenotypeData genotypeDataWritten = RandomAccessGenotypeDataReaderFormats.PLINK_BED.createGenotypeData(tmpOutputFolder.getAbsolutePath() + fileSep + "test8samples", 0); assertTrue(GenotypeDataCompareTool.same(genotypeData, genotypeDataWritten)); }
@Test public void testWrite_String4() throws Exception { GenotypeData genotypeData = new BedBimFamGenotypeData(getTestBed9(), getTestBim9(), getTestFam9(), 0); BedBimFamGenotypeWriter writer = new BedBimFamGenotypeWriter(genotypeData); writer.write(tmpOutputFolder.getAbsolutePath() + fileSep + "test9samples"); GenotypeData genotypeDataWritten = RandomAccessGenotypeDataReaderFormats.PLINK_BED.createGenotypeData(tmpOutputFolder.getAbsolutePath() + fileSep + "test9samples", 0); assertTrue(GenotypeDataCompareTool.same(genotypeData, genotypeDataWritten)); genotypeData.close(); genotypeDataWritten.close(); }