### Question:
NettyResponseFuture implements ListenableFuture<V> { @Override public V get() throws InterruptedException, ExecutionException { return future.get(); } NettyResponseFuture(Request originalRequest,
                             AsyncHandler<V> asyncHandler,
                             NettyRequest nettyRequest,
                             int maxRetry,
                             ChannelPoolPartitioning connectionPoolPartitioning,
                             ConnectionSemaphore connectionSemaphore,
                             ProxyServer proxyServer); Object takePartitionKeyLock(); @Override boolean isDone(); @Override boolean isCancelled(); @Override boolean cancel(boolean force); @Override V get(); @Override V get(long l, TimeUnit tu); final void done(); final void abort(final Throwable t); @Override void touch(); @Override ListenableFuture<V> addListener(Runnable listener, Executor exec); @Override CompletableFuture<V> toCompletableFuture(); Uri getUri(); ProxyServer getProxyServer(); void cancelTimeouts(); final Request getTargetRequest(); void setTargetRequest(Request targetRequest); final Request getCurrentRequest(); void setCurrentRequest(Request currentRequest); final NettyRequest getNettyRequest(); final void setNettyRequest(NettyRequest nettyRequest); final AsyncHandler<V> getAsyncHandler(); void setAsyncHandler(AsyncHandler<V> asyncHandler); final boolean isKeepAlive(); final void setKeepAlive(final boolean keepAlive); int incrementAndGetCurrentRedirectCount(); TimeoutsHolder getTimeoutsHolder(); void setTimeoutsHolder(TimeoutsHolder timeoutsHolder); boolean isInAuth(); void setInAuth(boolean inAuth); boolean isAndSetInAuth(boolean set); boolean isInProxyAuth(); void setInProxyAuth(boolean inProxyAuth); boolean isAndSetInProxyAuth(boolean inProxyAuth); ChannelState getChannelState(); void setChannelState(ChannelState channelState); boolean isStreamConsumed(); void setStreamConsumed(boolean streamConsumed); long getLastTouch(); boolean isHeadersAlreadyWrittenOnContinue(); void setHeadersAlreadyWrittenOnContinue(boolean headersAlreadyWrittenOnContinue); boolean isDontWriteBodyBecauseExpectContinue(); void setDontWriteBodyBecauseExpectContinue(boolean dontWriteBodyBecauseExpectContinue); boolean isConnectAllowed(); void setConnectAllowed(boolean allowConnect); void attachChannel(Channel channel, boolean reuseChannel); Channel channel(); boolean isReuseChannel(); void setReuseChannel(boolean reuseChannel); boolean incrementRetryAndCheck(); boolean isReplayPossible(); long getStart(); Object getPartitionKey(); void acquirePartitionLockLazily(); Realm getRealm(); void setRealm(Realm realm); Realm getProxyRealm(); void setProxyRealm(Realm proxyRealm); @Override String toString(); public Throwable pendingException; }### Answer:
@Test public void testGet() throws Exception { @SuppressWarnings("unchecked") AsyncHandler<Object> asyncHandler = mock(AsyncHandler.class); Object value = new Object(); when(asyncHandler.onCompleted()).thenReturn(value); NettyResponseFuture<?> nettyResponseFuture = new NettyResponseFuture<>(null, asyncHandler, null, 3, null, null, null); nettyResponseFuture.done(); Object result = nettyResponseFuture.get(); assertEquals(result, value, "The Future should return the value given by asyncHandler#onCompleted"); }