assertOpenEventually(latch1);
final AtomicReference reference1 = new AtomicReference();
final AtomicReference reference2 = new AtomicReference();
final ICompletableFuture completableFuture = es.asCompletableFuture(future);
completableFuture.andThen(new ExecutionCallback() {
@Override
public void onResponse(Object response) {
reference1.set(response);
latch2.countDown();
}
@Override
public void onFailure(Throwable t) {
reference1.set(t);
latch2.countDown();
}
});
completableFuture.andThen(new ExecutionCallback() {
@Override
public void onResponse(Object response) {
reference2.set(response);
latch2.countDown();
}