@Override
  public List<PurgeableAnalysisDto> filter(List<PurgeableAnalysisDto> history) {
    List<PurgeableAnalysisDto> result = new ArrayList<>();
    for (PurgeableAnalysisDto snapshot : history) {
      if (snapshot.getDate().before(before)) {
        result.add(snapshot);
      }
    }
    return result;
  }
@Test
  void shouldDeleteAllSnapshotsPriorToDate() {
    Filter filter = new DeleteAllFilter(DateUtils.parseDate("2011-12-25"));

    List<PurgeableAnalysisDto> toDelete = filter.filter(Arrays.asList(
      DbCleanerTestUtils.createAnalysisWithDate("u1", "2010-01-01"),
      DbCleanerTestUtils.createAnalysisWithDate("u2", "2010-12-25"),
      DbCleanerTestUtils.createAnalysisWithDate("u3", "2012-01-01")));

    assertThat(toDelete).extracting("analysisUuid").containsOnly("u1", "u2");
  }