BaselineExperimentSearchResultProducer { public BaselineExperimentProfilesList buildProfilesForExperiments( Map<String, Map<String, Double>> expressionsPerColumnPerExperiment, String factorType) { return trimAndSort(profilesForExpressions(expressionsPerColumnPerExperiment, factorType)); } BaselineExperimentSearchResultProducer(ExperimentTrader experimentTrader); BaselineExperimentProfilesList buildProfilesForExperiments(
            Map<String, Map<String, Double>> expressionsPerColumnPerExperiment, String factorType);  }
@Test public void threeDataPointsGiveThreeConditions() { Map<String, Map<String, Double>> dataInSolr = ImmutableMap.of( singleFactorExperiment.getAccession(), ImmutableMap.of("g1", 1.0, "g2", 2.0, "g3", 3.0)); Collection<BaselineExperimentProfile> result = subject.buildProfilesForExperiments(dataInSolr, factorType); assertThat(result.size(), is(1)); assertThat(result.iterator().next().getSpecificity(), is(3L)); }
@Test public void twoDataPointsGiveThreeConditionsButLastOneIsEmpty() { Map<String, Map<String, Double>> dataInSolr = ImmutableMap.of(singleFactorExperiment.getAccession(), ImmutableMap.of("g1", 1.0, "g2", 2.0)); Collection<BaselineExperimentProfile> result = subject.buildProfilesForExperiments(dataInSolr, factorType); assertThat(result.size(), is(1)); assertThat(result.iterator().next().getSpecificity(), is(2L)); assertThat(result.iterator().next().getConditions().size(), is(3)); }