FutureTaskResultToDomainObjectPromiseWrapper implements Promise<DomainObject> { @Override public void await() throws InterruptedException { try { for (Future<TaskResult> future : futureList) { future.get(); } } catch (ExecutionException exception) { throw new InterruptedException(exception.getMessage()); } catch (CancellationException ignored) { } } FutureTaskResultToDomainObjectPromiseWrapper(Future<TaskResult> future);  FutureTaskResultToDomainObjectPromiseWrapper(Future<TaskResult> future, boolean throwOriginalException);  FutureTaskResultToDomainObjectPromiseWrapper(ResponseMerger<DomainObject> responseMerger);  FutureTaskResultToDomainObjectPromiseWrapper(ResponseMerger<DomainObject> responseMerger, boolean throwOriginalException); @Override boolean isRealized(); @Override boolean isFullfilled(); @Override boolean isBroken(); @Override void await(); @Override void await(long timeout, TimeUnit timeUnit); @Override DomainObject get(); @Override DomainObject get(long timeout, TimeUnit timeUnit); Map<String, String> getHeaders(); @Override synchronized void addListener(PromiseListener promiseListener); void addFutureForTask(Future<TaskResult> future); void addFutureForTask(List<Future<TaskResult>> future); List<Future<TaskResult>> getFutureList();  }
@Test public void testAwait() throws Exception { wrapper.await(); Mockito.verify(future1).get(); Mockito.verify(future2).get(); }