VcfWriter { public static void writeColumnHeader(final List<VcfSample> samples, final PrintWriter writer) { checkNotNull(samples); checkNotNull(writer); StringBuilder sb = new StringBuilder("#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO"); if (!samples.isEmpty()) { sb.append("\tFORMAT"); } for (VcfSample sample : samples) { sb.append("\t"); sb.append(sample.getId()); } writer.println(sb.toString()); } 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 testWriteColumnHeaderNullSamples() throws Exception { writeColumnHeader(null, writer); }
@Test(expected=NullPointerException.class) public void testWriteColumnHeaderNullWriter() throws Exception { writeColumnHeader(samples, null); }
@Test public void testWriteColumnHeader() throws Exception { writeColumnHeader(samples, writer); writer.close(); assertEquals("#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO\tFORMAT\tNA19131" + System.lineSeparator(), outputStream.toString()); }