@Test void returnsEmptyIfNoAccessionMatches() { assertThat(subject.searchPublicExperimentsByAccession(ACCESSION_PATTERN + randomAlphabetic(1))) .isEmpty(); }
public ImmutableSet<Experiment> searchPublicExperimentsByAccession(String accessionSubstring) { return experimentTrader.getPublicExperiments() .stream() .filter(experiment -> containsIgnoreCase(experiment.getAccession(), accessionSubstring)) .collect(toImmutableSet()); }
ExperimentSearchService { public ImmutableSet<Experiment> searchPublicExperimentsByAccession(String accessionSubstring) { return experimentTrader.getPublicExperiments() .stream() .filter(experiment -> containsIgnoreCase(experiment.getAccession(), accessionSubstring)) .collect(toImmutableSet()); } }
ExperimentSearchService { public ImmutableSet<Experiment> searchPublicExperimentsByAccession(String accessionSubstring) { return experimentTrader.getPublicExperiments() .stream() .filter(experiment -> containsIgnoreCase(experiment.getAccession(), accessionSubstring)) .collect(toImmutableSet()); } ExperimentSearchService(ExperimentTrader experimentTrader); }
ExperimentSearchService { public ImmutableSet<Experiment> searchPublicExperimentsByAccession(String accessionSubstring) { return experimentTrader.getPublicExperiments() .stream() .filter(experiment -> containsIgnoreCase(experiment.getAccession(), accessionSubstring)) .collect(toImmutableSet()); } ExperimentSearchService(ExperimentTrader experimentTrader); ImmutableSet<Experiment> searchPublicExperimentsBySpecies(String speciesSubstring); ImmutableSet<Experiment> searchPublicExperimentsByAccession(String accessionSubstring); }
ExperimentSearchService { public ImmutableSet<Experiment> searchPublicExperimentsByAccession(String accessionSubstring) { return experimentTrader.getPublicExperiments() .stream() .filter(experiment -> containsIgnoreCase(experiment.getAccession(), accessionSubstring)) .collect(toImmutableSet()); } ExperimentSearchService(ExperimentTrader experimentTrader); ImmutableSet<Experiment> searchPublicExperimentsBySpecies(String speciesSubstring); ImmutableSet<Experiment> searchPublicExperimentsByAccession(String accessionSubstring);  }