@Test
public void doDetectionWithFiltering() {

    when(detectorContainer.getFilters()).thenReturn(ImmutableList.of(detectionFilter));
    val filterChain = new DetectionFilterChain(detectorContainer);
    doAnswer(invocation -> {
        DetectorResponse response = invocation.getArgument(1);
        response.setDetectorResult(detectorResult);
        return null;
    }).when(detectionFilter).doFilter(any(DetectorRequest.class), any(DetectorResponse.class), any(DetectionFilterChain.class));
    DetectorResult actualResult = executorUnderTest.doDetection(detectorContainer, metricData);
    assertSame(detectorResult, actualResult);
}