@Test
public void testThenRun() throws Throwable {

    TestContext ctx = new TestContext(1, TestContext.DEFAULT_WAIT_DURATION);
    AtomicInteger invocations = new AtomicInteger();
    DeferredResult<Integer> original = new DeferredResult<>();
    original
        .thenRun(() -> {
            invocations.incrementAndGet();
        })
        .whenComplete(ctx.getCompletionDeferred());
    runAfter(10, () -> original.complete(1));
    ctx.await();
    Assert.assertEquals(1, invocations.get());
}