FutureTaskResultToDomainObjectPromiseWrapper implements Promise<DomainObject> { @Override public synchronized void addListener(PromiseListener promiseListener) { throw new UnsupportedOperationException("Adding listeners is not supported"); } 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 testAddListeners() throws Exception { PromiseListener listener = mock(PromiseListener.class); exception.expect(UnsupportedOperationException.class); exception.expectMessage(equalTo("Adding listeners is not supported")); wrapper.addListener(listener); }