void (CancellablePromise<Object> promise, AtomicReference<Throwable> loggedError, BoundedTaskExecutor executor) { Throwable cause = null; try { waitForFuture(promise); } catch (Throwable e) { cause = ExceptionUtil.getRootCause(e); } assertInstanceOf(cause, UnsupportedOperationException.class); try { executor.waitAllTasksExecuted(1, TimeUnit.SECONDS); } catch (ExecutionException | InterruptedException | TimeoutException e) { throw new RuntimeException(e); } assertSame(cause, loggedError.getAndSet(null)); }