SummaryFile { @NotNull public static SummaryModel buildFromTsv(@NotNull String sampleSummaryTsv) throws IOException { List<String> linesSampleSummary = LineReader.build().readLines(new File(sampleSummaryTsv).toPath(), line -> line.length() > 0); Map<String, String> sampleToSummaryMap = Maps.newHashMap(); for (String line : linesSampleSummary) { String[] parts = line.split(SEPARATOR); if (parts.length == 2) { String sampleId = parts[0].trim(); String summaryOfSample = parts[1].trim(); summaryOfSample = summaryOfSample.replace(LINE_BREAK_STRING, "\n"); sampleToSummaryMap.put(sampleId, summaryOfSample); } else { LOGGER.warn("Suspicious line detected in sample summary tsv: {}", line); } } return new SummaryModel(sampleToSummaryMap); } private  SummaryFile(); @NotNull static SummaryModel buildFromTsv(@NotNull String sampleSummaryTsv);  }
@Test public void summaryFromCSVWithNewLines() throws IOException { SummaryModel summaryModel = SummaryFile.buildFromTsv(SAMPLE_SUMMARY_TSV); assertEquals(1, summaryModel.summaryCount()); String summary = summaryModel.findSummaryForSample("sample"); assertEquals(3, summary.split("\n").length); }