@Test
public void testNoStackOverflow()
        throws Exception
{

    AsyncSemaphore<Object> asyncSemaphore = new AsyncSemaphore<>(1, executor, object -> Futures.immediateFuture(null));
    List<ListenableFuture<?>> futures = new ArrayList<>();
    for (int i = 0; i < 1000; i++) {
        futures.add(asyncSemaphore.submit(new Object()));
    }
    // Wait for completion
    Futures.allAsList(futures).get(1, TimeUnit.MINUTES);
}