### Question:
ListenableFutureRpcProcessor implements BiConsumer<StorageServerChannel, Throwable>,
    FutureCallback<ResponseT>,
    Runnable { public CompletableFuture<ResultT> process() { serverChannelFuture = scChannel.getStorageContainerChannelFuture(); serverChannelFuture.whenCompleteAsync(this, executor); return resultFuture; } protected  ListenableFutureRpcProcessor(StorageContainerChannel channel,
                                           ScheduledExecutorService executor,
                                           Policy backoffPolicy); CompletableFuture<ResultT> process(); @Override void run(); @Override void accept(StorageServerChannel storageServerChannel, Throwable cause); @Override void onSuccess(ResponseT result); @Override void onFailure(Throwable t);  }### Answer:
@Test public void testFailToConnect() { CompletableFuture<StorageServerChannel> serverFuture = new CompletableFuture<>(); when(scChannel.getStorageContainerChannelFuture()).thenReturn(serverFuture); CompletableFuture<String> resultFuture = processor.process(); verify(scChannel, times(1)).getStorageContainerChannelFuture(); Exception testExc = new Exception("test-exception"); serverFuture.completeExceptionally(testExc); try { FutureUtils.result(resultFuture); fail("Should fail the process if failed to connect to storage server"); } catch (Exception e) { assertSame(testExc, e); } }