### Question:
ResponseExpectedRpcListener extends AbstractRpcListener<T> { @SuppressWarnings("unchecked") public void completed(final OfHeader message) { successfulRpc((T)message); } ResponseExpectedRpcListener(final Object message, final String failureInfo,
            final Cache<RpcResponseKey, ResponseExpectedRpcListener<?>> cache, final RpcResponseKey key); void discard(); @SuppressWarnings("unchecked") void completed(final OfHeader message);  }### Answer:
@Test public void testCompleted() { RpcResponseKey key = new RpcResponseKey(12345L, BarrierOutput.class.getName()); ResponseExpectedRpcListener<OfHeader> listener = new ResponseExpectedRpcListener<>("MESSAGE", "Failed to send message", responseCache, key); BarrierInputBuilder barrierBuilder = new BarrierInputBuilder(); BarrierInput barrierInput = barrierBuilder.build(); listener.completed(barrierInput); SettableFuture<RpcResult<?>> result = SettableFuture.create(); result.set(RpcResultBuilder.success(barrierInput).build()); try { Assert.assertEquals("Wrong result", result.get().getErrors(), listener.getResult().get().getErrors()); Assert.assertEquals("Wrong result", result.get().getResult(), listener.getResult().get().getResult()); Assert.assertEquals("Wrong result", result.get().isSuccessful(), listener.getResult().get().isSuccessful()); } catch (InterruptedException | ExecutionException e) { fail("Problem accessing result"); } }