@Test
public void cacheNulls() {

    AsyncLoadingCache<String, String> cache = new AsyncLoadingCache<>(100);
    final AtomicInteger counter = new AtomicInteger();
    CompletableFuture<Void> signal = new CompletableFuture<>();
    final Supplier<CompletableFuture<String>> supplier = () -> {
        counter.incrementAndGet();
        return signal.thenApply(ignored -> null);
    };
    CompletableFuture<String> future = cache.orElseGet("key", supplier);
    assertEquals(1, counter.get());
    signal.complete(null);
    String value = future.join();
    assertNull(value);
    CompletableFuture<String> cachedFuture = cache.orElseGet("key", supplier);
    assertEquals(1, counter.get()); // supplier should not need to run
    value = cachedFuture.join();
    assertNull(value);
}