code: public ByteBuffer sendRpcSync(ByteBuffer message, long timeoutMs) {
      final SettableFuture<ByteBuffer> result = SettableFuture.create();
  
      sendRpc(message, new RpcResponseCallback() {
        @Override
        public void onSuccess(ByteBuffer response) {
          ByteBuffer copy = ByteBuffer.allocate(response.remaining());
          copy.put(response);
          // flip "copy" to make it readable
          copy.flip();
          result.set(copy);
        }
  
        @Override
        public void onFailure(Throwable e) {
          result.setException(e);
        }
      });
  
      try {
        return result.get(timeoutMs, TimeUnit.MILLISECONDS);
      } catch (ExecutionException e) {
        throw Throwables.propagate(e.getCause());
      } catch (Exception e) {
        throw Throwables.propagate(e);
      }
    }
docs: Synchronously sends an opaque message to the RpcHandler on the server-side, waiting for up to
  a specified timeout for a response.