@Test(timeout = 100)
public void testCacheLoadDoesNotBlock() throws Throwable {

    final BlockingScheduler scheduler = new BlockingScheduler();
    server.setScheduler(scheduler);
    server.setPlayer(testPlayer);
    final Thread mainThread = Thread.currentThread();
    server.setPrimaryThread(mainThread);
    Waiter waiter = new Waiter();
    final AtomicReference<BukkitPlayer> asyncPlayer = new AtomicReference<>();
    scheduler.setWaiter(waiter);
    new Thread(() -> {
        // Wait for this thread to start it's query, so we know it runs first.
        // The BlockingScheduler will automatically call waiter.resume() when the
        // callSyncMethod() function is called.
        asyncPlayer.set(api.getAuthorById(testPlayer.getUniqueId()));
        waiter.assertEquals(asyncPlayer.get().getId(), testPlayer.getUniqueId());
        waiter.resume();
    }).start();
    // Wait for the call to be scheduled
    waiter.await();
    // This should not block
    BukkitPlayer myPlayer = api.getAuthorById(testPlayer.getUniqueId());
    // Now release the thread.
    scheduler.releaseTask();
    waiter.await();
    assertEquals(asyncPlayer.get(), myPlayer);
}