@Test public void shouldCheckRepoExistenceBeforeTryingPurge() throws IOException, IllegalAccessException { factory.createSuiteTimeRepo("foo", LATEST_VERSION); Cache<EntryRepo> repos = (Cache<EntryRepo>) deref("cache", factory); List<String> keys = repos.keys(); assertThat(keys.size(), is(1)); String fooKey = keys.get(0); repos.clear(); try { factory.purge(fooKey); } catch (IOException e) { e.printStackTrace(); fail("Should not fail when trying to purge already purged entry"); } }