@Test void searchByAccession() { assertThat(subject.searchPublicExperimentsByAccession(ACCESSION_PATTERN)) .size() .isBetween(1, MATCH_EXPERIMENTS_COUNT); String searchPattern = ACCESSION_PATTERN.substring(0, RNG.nextInt(1, ACCESSION_PATTERN.length())); assertThat(subject.searchPublicExperimentsByAccession(searchPattern)) .size() .isGreaterThanOrEqualTo(MATCH_EXPERIMENTS_COUNT); }
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);  }