@Test
public void testDupHandling() {

    // test that objects that should be marked as duplicates (same hashcode/ equals) are not added
    // multiple times in the MRU cache
    PersistentObjectCacheWithMRUSort<Bam> cache =
            builder.withRefresher(new NoopRefresher<Bam>())
                    .withMruSort().build();
    Bam first = new Bam(1, "first");
    Bam firstDuplicate = new Bam(1, "second"); // note the same id
    CurrentTime.freezeAt(1000);
    cache.put(first);
    CurrentTime.freezeAt(2000);
    cache.put(firstDuplicate);
    Assert.assertEquals(1, cache.valuesByMostRecentlyUsed().size());
}