### Question:
DeferredResult { public DeferredResult success(Handler handler) { synchronized (successHandlers) { successHandlers.add(handler); } if (done && success) invokeSuccess(); return this; }  DeferredResult success(Handler handler); DeferredResult failure(Handler handler); DeferredResult done(Handler handler); void sendSuccess(Object data); void sendFailure(Object data); boolean isDone(); @SuppressWarnings("unchecked") T getResult(); T waitSuccess(); T await(); T await(long millis); final DeferredResult join(); boolean isSuccess(); final boolean join(long millis);  }### Answer:
@Test public void success() throws Exception { DeferredResult dr = new DeferredResult(); dr.success( (text-> assertEquals("hello", text))); dr.sendSuccess("hello"); }