VcfWriter { public static void write(final VcfHeader header, final List<VcfSample> samples, final List<VcfRecord> records, final PrintWriter writer) { writeHeader(header, writer); writeColumnHeader(samples, writer); writeRecords(samples, records, writer); } private  VcfWriter(); static void write(final VcfHeader header,
                             final List<VcfSample> samples,
                             final List<VcfRecord> records,
                             final PrintWriter writer); static void writeHeader(final VcfHeader header, final PrintWriter writer); static void writeColumnHeader(final List<VcfSample> samples, final PrintWriter writer); static void writeRecords(final List<VcfSample> samples,
                                    final List<VcfRecord> records,
                                    final PrintWriter writer); static void writeRecord(final List<VcfSample> samples, final VcfRecord record, final PrintWriter writer);  }
@Test(expected=NullPointerException.class) public void testWriteNullHeader() throws Exception { write(null, samples, records, writer); }
@Test(expected=NullPointerException.class) public void testWriteNullSamples() throws Exception { write(header, null, records, writer); }
@Test(expected=NullPointerException.class) public void testWriteNullRecords() throws Exception { write(header, samples, null, writer); }
@Test(expected=NullPointerException.class) public void testWriteNullWriter() throws Exception { write(header, samples, records, null); }
@Test public void testWrite() throws Exception { write(header, samples, records, writer); writer.close(); assertEquals("##fileformat=VCFv4.1" + System.lineSeparator() + "#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO\tFORMAT\tNA19131" + System.lineSeparator() + "22\t16140370\trs2096606\tA\tG\t100\tPASS\t.\tGT\t1|1" + System.lineSeparator(), outputStream.toString()); }