@Test
public void testRemoveOutdatedBlacklistVersions()
{

  assertThat("The initial database must contain 5 entries", getNumberOfRows(), is(5));
  // cleanup should not delete any entries as they are all the same version
  connector.removeOutdatedVersionsFromBlacklistentry();
  assertThat("No current versions should be deleted", getNumberOfRows(), is(5));
  // Add entries with older blacklist version
  for ( int i = 0 ; i < 10 ; i++ )
  {
    addEntryToBlacklistentry(Base64.getEncoder().encodeToString("XXX".getBytes(StandardCharsets.UTF_8)),
                             UUID.randomUUID().toString(),
                             "1000");
  }
  assertThat("There must be 15 entries", getNumberOfRows(), is(15));
  // Perform the clean up
  connector.removeOutdatedVersionsFromBlacklistentry();
  assertThat("The 10 outdated entries should be deleted", getNumberOfRows(), is(5));
  List<Long> expected = Arrays.asList(1337L);
  assertThat("Only the recent blacklist version should be present",
             getUniqueBlacklistVersions(),
             Matchers.containsInAnyOrder(expected.toArray()));
}