title: Write junit test cases for the Future callback
body: <p>Can someone help to write JUnit test for below section of code especially the add callback part?
  I am not sure how to write unit test cases for the Listenablefuture with the callback</p>
  
  <pre><code>    private void handleResponse(final ListenableFuture&lt;UserRecordResult&gt; response, CompletableFuture future) {
  
          Futures.addCallback(response, new FutureCallback&lt;UserRecordResult&gt;() {
  
              @Override
              public void onFailure(@Nonnull Throwable throwable) {
  
                  future.completeExceptionally(new Exception("Fail to put record" + throwable.getMessage()));
              }
  
              @Override
              public void onSuccess(UserRecordResult result) {
                  if(result.isSuccessful()) {
                      future.complete(true);
                  } else {
                      future.completeExceptionally(new Exception("Fail to put record"));
                  }
              }
          });
      }
  </code></pre>