FittedPurityRangeFile { @NotNull @VisibleForTesting static List<String> toLines(@NotNull final List<FittedPurity> purity) { final List<String> lines = Lists.newArrayList(); lines.add(header()); purity.stream().map(FittedPurityRangeFile::toString).forEach(lines::add); return lines; }  @NotNull static String generateFilenameForReading(@NotNull final String basePath, @NotNull final String sample); @NotNull static List<FittedPurity> readAll(@NotNull final String basePath, @NotNull final String sample); @NotNull static List<FittedPurity> readBestFitPerPurity(@NotNull final String basePath, @NotNull final String sample); static void write(@NotNull final String basePath, @NotNull final String sample, @NotNull final List<FittedPurity> purity);  }
@Test public void testHeaderIsGenerated() { int size = 4; final List<FittedPurity> purities = create(size); final List<String> toLines = FittedPurityRangeFile.toLines(purities); assertEquals(size + 1, toLines.size()); assertTrue(toLines.get(0).startsWith("purity")); }