RpcFuture implements AsyncAwareFuture<T> { @Override public T get() throws InterruptedException { latch.await(); if (response != null && response.getException() != null) { throw new RpcException(response.getException()); } if (response == null) { throw new RpcException(RpcException.TIMEOUT_EXCEPTION); } setRpcContext(); return (T) response.getResult(); } RpcFuture();  RpcFuture(long correlationId); static RpcFuture createRpcFuture(Request request); void init(Timeout timeout,
                     RpcMethodInfo rpcMethodInfo,
                     RpcCallback<T> callback,
                     ChannelInfo channelInfo); void handleConnection(Response response); void handleResponse(Response response); @Override boolean isAsync(); @Override boolean cancel(boolean mayInterruptIfRunning); @Override boolean isCancelled(); @Override boolean isDone(); @Override T get(); @Override T get(long timeout, TimeUnit unit); @Override String toString();  }
@Test public void testSyncHandleTimeout() throws Exception { try { rpcFuture.get(100, TimeUnit.MILLISECONDS); } catch (RpcException ex2) { Assert.assertTrue(ex2.getCode() == RpcException.TIMEOUT_EXCEPTION); } }