ExperimentDesignFileWriter { List<String[]> asTableOntologyTermsData(ExperimentDesign experimentDesign) { List<String[]> tableData = Lists.newArrayList(); tableData.addAll( experimentDesign.getAllRunOrAssay().stream() .map(runOrAssay -> composeTableRowWithOntologyTerms(experimentDesign, runOrAssay)) .collect(Collectors.toList())); return tableData; } ExperimentDesignFileWriter(TsvWriter tsvWriter, ExperimentType experimentType); void write(ExperimentDesign experimentDesign);  }
@Test public void test() { List<String[]> rows = subject.asTableOntologyTermsData(experimentDesign); assertThat( rows.get(0), is(new String[] { "ASSAY_1", "CHAR_1", "http: "CHAR_2", "UBERON:0000002", "CHAR_3", null, "ASSAY1_FACTOR", "http: "ASSAY1_FACTOR2", null })); assertThat( rows.get(1), is(new String[] { "ASSAY_2", "CHAR_1", "http: "CHAR_2", "UBERON:0000002", "CHAR_3", null, "ASSAY2_FACTOR", "F:2", "ASSAY2_FACTOR2", null })); assertThat( rows.get(2), is(new String[] { "ASSAY_3", "CHAR_1", "http: "CHAR_2", "UBERON:0000002", "CHAR_3", null, "ASSAY3_FACTOR", null, "ASSAY3_FACTOR2", null })); }