@Test
@UseDataProvider("requestFiltersByPath")
public void retrievesRequestFiltersByPath(boolean singletonOrPerRequest,
                                          String path,
                                          List<Object> expectedRequestFilterClassesOrInstances) throws Exception {

    if (singletonOrPerRequest == SINGLETON) {
        registerSingletonRequestFilters();
    } else {
        registerPerRequestRequestFilters();
    }
    List<RequestFilter> requestFilters = providers.getRequestFilters(path);
    if (singletonOrPerRequest == SINGLETON) {
        expectedRequestFilterClassesOrInstances.removeAll(requestFilters);
        assertTrue(String.format("Request filters %s expected but not found", expectedRequestFilterClassesOrInstances),
                   expectedRequestFilterClassesOrInstances.isEmpty());
    } else {
        List<Class> methodInvokerFiltersClasses = requestFilters.stream().map(Object::getClass).collect(toList());
        expectedRequestFilterClassesOrInstances.removeAll(methodInvokerFiltersClasses);
        assertTrue(String.format("Request filters %s expected but not found", expectedRequestFilterClassesOrInstances),
                   expectedRequestFilterClassesOrInstances.isEmpty());
    }
}