@Test
public void shouldCleanupUnunsedValues() throws Exception {

    getBinaryStore().storeValue(new ByteArrayInputStream(IN_MEMORY_BINARY), false);
    List<BinaryKey> keys = new ArrayList<BinaryKey>();
    keys.add(IN_MEMORY_KEY);
    getBinaryStore().markAsUnused(keys);
    Thread.sleep(100);
    // now remove and test if still there
    getBinaryStore().removeValuesUnusedLongerThan(1, TimeUnit.MILLISECONDS);
    try {
        // no annotation used here to differ from other BinaryStoreException
        getBinaryStore().getInputStream(IN_MEMORY_KEY);
        fail("Key was not removed");
    } catch (BinaryStoreException ex) {
    }
}