### Question:
TxPoolBesuStatistics implements JsonRpcMethod { @Override public JsonRpcResponse response(final JsonRpcRequestContext requestContext) { return new JsonRpcSuccessResponse(requestContext.getRequest().getId(), statistics()); } TxPoolBesuStatistics(final PendingTransactions pendingTransactions); @Override String getName(); @Override JsonRpcResponse response(final JsonRpcRequestContext requestContext);  }### Answer:
@Test public void shouldGiveStatistics() { final JsonRpcRequestContext request = new JsonRpcRequestContext( new JsonRpcRequest( JSON_RPC_VERSION, TXPOOL_PENDING_TRANSACTIONS_METHOD, new Object[] {})); final TransactionInfo local = createTransactionInfo(true); final TransactionInfo secondLocal = createTransactionInfo(true); final TransactionInfo remote = createTransactionInfo(false); when(pendingTransactions.maxSize()).thenReturn(123L); when(pendingTransactions.getTransactionInfo()) .thenReturn(Sets.newHashSet(local, secondLocal, remote)); final JsonRpcSuccessResponse actualResponse = (JsonRpcSuccessResponse) method.response(request); final PendingTransactionsStatisticsResult result = (PendingTransactionsStatisticsResult) actualResponse.getResult(); assertThat(result.getRemoteCount()).isEqualTo(1); assertThat(result.getLocalCount()).isEqualTo(2); assertThat(result.getMaxSize()).isEqualTo(123); }