@Test
void performAsyncTest() { // ugly white-box test as this code is nearly untestable from the outside

    final AsyncReloadableImpl<String> r = (AsyncReloadableImpl<String>) Reloadable.with(() -> "")
        .async()
        .build();
    final CompletableFuture<Void> first = r.refreshIfNotAlreadyRefreshing(null);
    assertThat(first).isNotNull();
    first.completeExceptionally(new IllegalStateException());
    final CompletableFuture<Void> second = r.refreshIfNotAlreadyRefreshing(first);
    assertThat(second).isNotNull()
        .isNotSameAs(first);
    final CompletableFuture<Void> third = mock(CompletableFuture.class);
    when(third.isDone()).thenReturn(false);
    assertThat(r.refreshIfNotAlreadyRefreshing(third)).isSameAs(third);
}