### Question:
EthMining implements JsonRpcMethod { @Override public JsonRpcResponse response(final JsonRpcRequestContext requestContext) { return new JsonRpcSuccessResponse( requestContext.getRequest().getId(), miningCoordinator.isMining()); } EthMining(final MiningCoordinator miningCoordinator); @Override String getName(); @Override JsonRpcResponse response(final JsonRpcRequestContext requestContext);  }### Answer:
@Test public void shouldReturnTrueWhenMining() { final JsonRpcRequestContext request = requestWithParams(); final JsonRpcResponse expectedResponse = new JsonRpcSuccessResponse(request.getRequest().getId(), true); when(miningCoordinator.isMining()).thenReturn(true); final JsonRpcResponse actualResponse = method.response(request); assertThat(actualResponse).isEqualToComparingFieldByField(expectedResponse); verify(miningCoordinator).isMining(); verifyNoMoreInteractions(miningCoordinator); }
@Test public void shouldReturnFalseWhenNotMining() { final JsonRpcRequestContext request = requestWithParams(); final JsonRpcResponse expectedResponse = new JsonRpcSuccessResponse(request.getRequest().getId(), false); when(miningCoordinator.isMining()).thenReturn(false); final JsonRpcResponse actualResponse = method.response(request); assertThat(actualResponse).isEqualToComparingFieldByField(expectedResponse); verify(miningCoordinator).isMining(); verifyNoMoreInteractions(miningCoordinator); }