ExperimentDesignFileWriter { String[] buildColumnHeaders(ExperimentType type, ExperimentDesign experimentDesign) { List<String> headers = Lists.newArrayList(getCommonColumnHeaders(type)); headers.addAll( toHeaders( experimentDesign.getSampleHeaders(), SAMPLE_CHARACTERISTICS_NAME_HEADER_TEMPLATE, SAMPLE_CHARACTERISTICS_ONTOLOGY_TERM_HEADER_TEMPLATE)); headers.addAll(toHeaders( experimentDesign.getFactorHeaders(), FACTOR_NAME_HEADER_TEMPLATE, FACTOR_VALUE_ONTOLOGY_TERM_TEMPLATE)); return headers.toArray(new String[0]); } ExperimentDesignFileWriter(TsvWriter tsvWriter, ExperimentType experimentType); void write(ExperimentDesign experimentDesign);  }
@Test public void testHeaders() { String[] headers = subject.buildColumnHeaders(ExperimentType.RNASEQ_MRNA_BASELINE, experimentDesign); assertThat( headers, is(new String[] { "Run", "Sample Characteristic[CHARACTERISTIC_1]", "Sample Characteristic Ontology Term[CHARACTERISTIC_1]", "Sample Characteristic[CHARACTERISTIC_2]", "Sample Characteristic Ontology Term[CHARACTERISTIC_2]", "Sample Characteristic[CHARACTERISTIC_3]", "Sample Characteristic Ontology Term[CHARACTERISTIC_3]", "Factor Value[FACTOR_1]", "Factor Value Ontology Term[FACTOR_1]", "Factor Value[FACTOR_2]", "Factor Value Ontology Term[FACTOR_2]" })); }