@Test
public void runIsSynchronous() throws Exception {

    final long timeout = 5000;

    Callable<Boolean> task = new Callable<Boolean>() {
        @Override
        public Boolean call() throws Exception {
            Thread.sleep(timeout);
            return false;
        }
    };

    long startTime = System.currentTimeMillis();

    Boolean result = AsyncRunner.run(task);

    long endTime = System.currentTimeMillis();

    assertThat(result, is(false));
    assertThat(endTime - startTime, greaterThanOrEqualTo(timeout));
}