@Test void returnsEmptyIfNoSpeciesMatches() { assertThat(subject.searchPublicExperimentsBySpecies(SPECIES.getReferenceName() + randomAlphabetic(1))) .isEmpty(); }
public ImmutableSet<Experiment> searchPublicExperimentsBySpecies(String speciesSubstring) { return experimentTrader.getPublicExperiments() .stream() .filter(experiment -> containsIgnoreCase(experiment.getSpecies().getName(), speciesSubstring) || containsIgnoreCase(experiment.getSpecies().getReferenceName(), speciesSubstring) || containsIgnoreCase(experiment.getSpecies().getEnsemblName(), speciesSubstring)) .collect(toImmutableSet()); }
ExperimentSearchService { public ImmutableSet<Experiment> searchPublicExperimentsBySpecies(String speciesSubstring) { return experimentTrader.getPublicExperiments() .stream() .filter(experiment -> containsIgnoreCase(experiment.getSpecies().getName(), speciesSubstring) || containsIgnoreCase(experiment.getSpecies().getReferenceName(), speciesSubstring) || containsIgnoreCase(experiment.getSpecies().getEnsemblName(), speciesSubstring)) .collect(toImmutableSet()); } }
ExperimentSearchService { public ImmutableSet<Experiment> searchPublicExperimentsBySpecies(String speciesSubstring) { return experimentTrader.getPublicExperiments() .stream() .filter(experiment -> containsIgnoreCase(experiment.getSpecies().getName(), speciesSubstring) || containsIgnoreCase(experiment.getSpecies().getReferenceName(), speciesSubstring) || containsIgnoreCase(experiment.getSpecies().getEnsemblName(), speciesSubstring)) .collect(toImmutableSet()); } ExperimentSearchService(ExperimentTrader experimentTrader); }
ExperimentSearchService { public ImmutableSet<Experiment> searchPublicExperimentsBySpecies(String speciesSubstring) { return experimentTrader.getPublicExperiments() .stream() .filter(experiment -> containsIgnoreCase(experiment.getSpecies().getName(), speciesSubstring) || containsIgnoreCase(experiment.getSpecies().getReferenceName(), speciesSubstring) || containsIgnoreCase(experiment.getSpecies().getEnsemblName(), speciesSubstring)) .collect(toImmutableSet()); } ExperimentSearchService(ExperimentTrader experimentTrader); ImmutableSet<Experiment> searchPublicExperimentsBySpecies(String speciesSubstring); ImmutableSet<Experiment> searchPublicExperimentsByAccession(String accessionSubstring); }
ExperimentSearchService { public ImmutableSet<Experiment> searchPublicExperimentsBySpecies(String speciesSubstring) { return experimentTrader.getPublicExperiments() .stream() .filter(experiment -> containsIgnoreCase(experiment.getSpecies().getName(), speciesSubstring) || containsIgnoreCase(experiment.getSpecies().getReferenceName(), speciesSubstring) || containsIgnoreCase(experiment.getSpecies().getEnsemblName(), speciesSubstring)) .collect(toImmutableSet()); } ExperimentSearchService(ExperimentTrader experimentTrader); ImmutableSet<Experiment> searchPublicExperimentsBySpecies(String speciesSubstring); ImmutableSet<Experiment> searchPublicExperimentsByAccession(String accessionSubstring);  }