@Test
public void testClear() {

    AsyncLoadingCache<String, Integer> cachedResult = new AsyncLoadingCache<>(30000);
    AtomicInteger value = new AtomicInteger(111);
    Supplier<CompletableFuture<Integer>> supplier = () -> CompletableFuture.supplyAsync(value::get);
    consistently("we get the original value", () -> cachedResult.orElseGet("a-key", supplier).join(), is(111), 10, 2);
    value.getAndSet(222);
    consistently("we still see the cached value", () -> cachedResult.orElseGet("a-key", supplier).join(), is(111), 10, 2);
    cachedResult.clear();
    consistently("we see the new value", () -> cachedResult.orElseGet("a-key", supplier).join(), is(222), 10, 2);
}