@Test
public void shouldListOnlyPreparationsContainingGivenName() {

    final List<Integer> ids = Arrays.asList(1, 12, 3);
    // store preparations
    final List<Preparation> preparations = ids
            .stream() //
            .map(i -> getPreparation(String.valueOf(i))) //
            .collect(Collectors.toList());
    preparations.forEach(prep -> repository.add(prep));
    // and some steps to add some noise
    ids
            .stream()
            .map(i -> new Step(Step.ROOT_STEP.id(), "step" + i, versionService.version().getVersionId())) //
            .forEach(step -> repository.add(step));
    // get some preparation by dataset id
    final Preparation expected1 = preparations.get(0);
    final Preparation expected2 = preparations.get(1);
    final Collection<Preparation> actual =
            repository.list(Preparation.class, contains("name", "1")).collect(Collectors.toList());
    assertEquals(2, actual.size());
    assertTrue(actual.contains(expected1));
    assertTrue(actual.contains(expected2));
}