### Question:
ClearVariableMonitoringRequestHandler implements OcppRequestHandler<ClearVariableMonitoringRequest> { @Override public void handle(String callId, ClearVariableMonitoringRequest request) { List<ClearMonitoringResult> results = request.getId().stream() .map(id -> new ClearMonitoringResult().withId(id).withStatus(tryClearMonitor(id))) .collect(Collectors.toList()); stationMessageSender.sendCallResult(callId, new ClearVariableMonitoringResponse().withClearMonitoringResult(results)); } ClearVariableMonitoringRequestHandler(StationComponentsHolder stationComponentsHolder, StationMessageSender stationMessageSender); @Override void handle(String callId, ClearVariableMonitoringRequest request);  }### Answer:
@Test void verifyCorrectNumberOfResponses() { final int size = 5; List<Integer> ids = new ArrayList<>(); for (int i = 0; i < size; i++) { ids.add(111); } ClearVariableMonitoringRequest request = new ClearVariableMonitoringRequest().withId(ids); handler.handle("1", request); verify(stationMessageSender).sendCallResult(anyString(), responseCaptor.capture()); ClearVariableMonitoringResponse response = responseCaptor.getValue(); assertThat(response.getClearMonitoringResult().size()).isEqualTo(size); assertTrue(response.getClearMonitoringResult().stream().allMatch(r -> r.getStatus() == ClearMonitoringResult.Status.NOT_FOUND)); assertTrue(response.getClearMonitoringResult().stream().allMatch(r -> r.getId() == 111)); }
@Test void verifyMonitoringIsCleared() { final int componentId = 111; when(stationComponentsHolder.clearMonitor(componentId)).thenReturn(true); ClearVariableMonitoringRequest request = new ClearVariableMonitoringRequest().withId(Collections.singletonList(componentId)); handler.handle("1", request); verify(stationComponentsHolder).clearMonitor(componentId); verify(stationMessageSender).sendCallResult(anyString(), responseCaptor.capture()); ClearVariableMonitoringResponse response = responseCaptor.getValue(); assertThat(response.getClearMonitoringResult()).hasSize(1); assertThat(response.getClearMonitoringResult().get(0).getStatus()).isEqualTo(ACCEPTED); }