### Question:
DefaultPromiseAdapter implements PromiseAdapter { @Override public <T> Handler<AsyncResult<T>> toHandler(Resolver<T> resolver) { return result -> { if (result.succeeded()) { resolver.resolve(result.result()); } else { resolver.reject(result.cause()); } }; } @Inject  DefaultPromiseAdapter(When when); @Override Promise<T> toPromise(Consumer<Handler<AsyncResult<T>>> consumer); @Override Handler<AsyncResult<T>> toHandler(Resolver<T> resolver);  }### Answer:
@Test public void testToHandler() throws Exception { Handler<AsyncResult<String>> handler = adapter.toHandler(resolver); handler.handle(result); verify(resolver).resolve(eq(success)); handler.handle(result); verify(resolver).reject(eq(cause)); }