ExperimentConfiguration { public List<Contrast> getContrasts() { return getContrastAndAnnotationPairs().stream().map(Pair::getLeft).collect(Collectors.toList()); } ExperimentConfiguration(XmlReader xmlReader); List<Pair<Contrast, Boolean>> getContrastAndAnnotationPairs(); List<Contrast> getContrasts(); List<AssayGroup> getAssayGroups(); ExperimentType getExperimentType();  }
@Test public void testGetContrasts() { List<Contrast> contrasts = testConfiguration(MICROARRAY_CONFIGURATION_XML).getContrasts(); assertThat(contrasts, hasSize(2)); Contrast contrast = contrasts.get(0); assertThat(contrast.getId(), is("g1_g2")); assertThat(contrast.getDisplayName(), is("'g1' vs 'g2'")); assertThat(contrast.getReferenceAssayGroup().assaysAnalyzedForThisDataColumn(), contains("A")); assertThat(contrast.getTestAssayGroup().assaysAnalyzedForThisDataColumn(), contains("A", "B")); Contrast otherContrast = contrasts.get(1); assertThat(otherContrast.getId(), is(not(contrast.getId()))); }
@Test(expected = IllegalArgumentException.class) public void testContrastNeedsDisplayName() { testConfiguration( "<configuration experimentType=\"microarray_1colour_mrna_differential\">" + "<analytics>" + "<contrasts>" + "<contrast id=\"id\"></contrast>" + "</contrasts>" + "</analytics>" + "</configuration>" ).getContrasts(); }