@Test
@UseDataProvider("responseFiltersByPath")
public void retrievesResponseFiltersByPath(boolean singletonOrPerRequest,
                                           String path,
                                           List<Object> expectedResponseFilterClassesOrInstances) throws Exception {

    if (singletonOrPerRequest == SINGLETON) {
        registerSingletonResponseFilters();
    } else {
        registerPerRequestResponseFilters();
    }
    List<ResponseFilter> responseFilters = providers.getResponseFilters(path);
    if (singletonOrPerRequest == SINGLETON) {
        expectedResponseFilterClassesOrInstances.removeAll(responseFilters);
        assertTrue(String.format("Response filters %s expected but not found", expectedResponseFilterClassesOrInstances),
                   expectedResponseFilterClassesOrInstances.isEmpty());
    } else {
        List<Class> methodInvokerFiltersClasses = responseFilters.stream().map(Object::getClass).collect(toList());
        expectedResponseFilterClassesOrInstances.removeAll(methodInvokerFiltersClasses);
        assertTrue(String.format("Response filters %s expected but not found", expectedResponseFilterClassesOrInstances),
                   expectedResponseFilterClassesOrInstances.isEmpty());
    }
}