@Test
public void getByDataSetTest() {

    // populate repository with noise (steps and preparations to be ignored)
    repository.add(getStep("s1"));
    repository.add(getStep("s2"));
    repository.add(getStep("s3"));
    repository.add(getStep("s4"));
    repository.add(getStep("s5"));
    repository.add(getPreparation("p1"));
    repository.add(getPreparation("p2"));
    repository.add(getPreparation("p3"));
    repository.add(getPreparation("p4"));
    repository.add(getPreparation("p5"));
    // add relevant data
    String dataSetId = "wantedId";
    Collection<Preparation> expected = Arrays.asList(getPreparation(dataSetId, "10"),
            getPreparation(dataSetId, "11"), getPreparation(dataSetId, "12"));
    for (Preparation preparation : expected) {
        repository.add(preparation);
    }
    // run the test
    Collection<Preparation> actual =
            getRepository().list(Preparation.class, eq("dataSetId", dataSetId)).collect(Collectors.toList());
    // check the result
    Assert.assertEquals(3, actual.size());
    for (Preparation preparation : expected) {
        Assert.assertTrue(actual.contains(preparation));
    }
}