@Test(timeout = 3000)
public void testNullTask() throws Exception {

  // Instantiate a new executor and start a new 'null' task ...
  final ThreadAsyncExecutor executor = new ThreadAsyncExecutor();
  final AsyncResult<Object> asyncResult = executor.startProcess(null);
  assertNotNull("The AsyncResult should not be 'null', even though the task was 'null'.", asyncResult);
  asyncResult.await(); // Prevent timing issues, and wait until the result is available
  assertTrue(asyncResult.isCompleted());
  try {
    asyncResult.getValue();
    fail("Expected ExecutionException with NPE as cause");
  } catch (final ExecutionException e) {
    assertNotNull(e.getMessage());
    assertNotNull(e.getCause());
    assertEquals(NullPointerException.class, e.getCause().getClass());
  }
}