### Question:
AdminGenerateLogBloomCache implements JsonRpcMethod { @Override public JsonRpcResponse response(final JsonRpcRequestContext requestContext) { final Optional<BlockParameter> startBlockParam = requestContext.getOptionalParameter(0, BlockParameter.class); final long startBlock; if (startBlockParam.isEmpty() || startBlockParam.get().isEarliest()) { startBlock = 0; } else if (startBlockParam.get().getNumber().isPresent()) { startBlock = startBlockParam.get().getNumber().get(); } else { startBlock = Long.MAX_VALUE; } final Optional<BlockParameter> stopBlockParam = requestContext.getOptionalParameter(1, BlockParameter.class); final long stopBlock; if (stopBlockParam.isEmpty()) { if (startBlockParam.isEmpty()) { stopBlock = -1L; } else { stopBlock = Long.MAX_VALUE; } } else if (stopBlockParam.get().isEarliest()) { stopBlock = 0; } else if (stopBlockParam.get().getNumber().isPresent()) { stopBlock = stopBlockParam.get().getNumber().get(); } else { stopBlock = Long.MAX_VALUE; } return new JsonRpcSuccessResponse( requestContext.getRequest().getId(), blockchainQueries .getTransactionLogBloomCacher() .map(cacher -> cacher.requestCaching(startBlock, stopBlock)) .orElse(null)); } AdminGenerateLogBloomCache(final BlockchainQueries blockchainQueries); @Override String getName(); @Override JsonRpcResponse response(final JsonRpcRequestContext requestContext);  }### Answer:
@Test public void requestWithZeroParameters_NoCacher_returnsNull() { final JsonRpcRequestContext request = new JsonRpcRequestContext( new JsonRpcRequest("2.0", "admin_generateLogBloomCache", new String[] {})); when(blockchainQueries.getTransactionLogBloomCacher()).thenReturn(Optional.empty()); final JsonRpcResponse actualResponse = method.response(request); verifyNoMoreInteractions(blockchainQueries); assertThat(actualResponse).isInstanceOf(JsonRpcSuccessResponse.class); assertThat(((JsonRpcSuccessResponse) actualResponse).getResult()).isNull(); }