@Test
public void asyncCallback() {

    final Executor mockExecutor = mock(Executor.class);
    final Runnable noop = () -> {
    };
    final CallbackCountDownLatch latch = new CallbackCountDownLatch(2, noop, mockExecutor);
    verify(mockExecutor, never()).execute(any());
    latch.countDown();
    verify(mockExecutor, never()).execute(any());
    latch.countDown();
    verify(mockExecutor).execute(any());
    // only called once
    latch.countDown();
    verify(mockExecutor).execute(any());
}