### Question:
NetVersion implements JsonRpcMethod { @Override public JsonRpcResponse response(final JsonRpcRequestContext requestContext) { return new JsonRpcSuccessResponse(requestContext.getRequest().getId(), networkId); } NetVersion(final Optional<BigInteger> netId); @Override String getName(); @Override JsonRpcResponse response(final JsonRpcRequestContext requestContext);  }### Answer:
@Test public void shouldReturnNetworkId() { final JsonRpcResponse expectedResponse = new JsonRpcSuccessResponse(null, NETWORK_ID.toString()); final JsonRpcResponse response = method.response(request()); assertThat(response).isEqualToComparingFieldByField(expectedResponse); }
@Test public void shouldReturnNullWhenNoNetworkId() { method = new NetVersion(Optional.empty()); final JsonRpcResponse expectedResponse = new JsonRpcSuccessResponse(null, "null"); final JsonRpcResponse response = method.response(request()); assertThat(response).isEqualToComparingFieldByField(expectedResponse); }