PurpleCopyNumberFile { @VisibleForTesting @NotNull static List<String> toLines(@NotNull final List<PurpleCopyNumber> copyNumbers) { final List<String> lines = Lists.newArrayList(); lines.add(header()); copyNumbers.stream().map(PurpleCopyNumberFile::toString).forEach(lines::add); return lines; } private  PurpleCopyNumberFile(); @NotNull static String generateFilenameForWriting(@NotNull final String basePath, @NotNull final String sample); @NotNull static String generateFilenameForReading(@NotNull final String basePath, @NotNull final String sample); @NotNull static String generateGermlineFilenameForWriting(@NotNull final String basePath, @NotNull final String sample); @NotNull static String generateGermlineFilenameForReading(@NotNull final String basePath, @NotNull final String sample); @NotNull static List<PurpleCopyNumber> read(final String filePath); static void write(@NotNull final String filename, @NotNull List<PurpleCopyNumber> copyNumbers);  }
@Test public void testHeaderIsGenerated() { int size = 4; final List<PurpleCopyNumber> copyNumbers = create(size); final List<String> toLines = toLines(copyNumbers); assertEquals(size + 1, toLines.size()); assertTrue(toLines.get(0).startsWith("chr")); }