@Test
@UseDataProvider("methodInvokerFiltersByPath")
public void retrievesMethodInvokerFiltersByPath(boolean singletonOrPerRequest,
                                                String path,
                                                List<Object> expectedMethodInvokerFilterClassesOrInstances) throws Exception {

    if (singletonOrPerRequest == SINGLETON) {
        registerSingletonMethodInvokerFilters();
    } else {
        registerPerRequestMethodInvokerFilters();
    }
    List<MethodInvokerFilter> methodInvokerFilters = providers.getMethodInvokerFilters(path);
    if (singletonOrPerRequest == SINGLETON) {
        expectedMethodInvokerFilterClassesOrInstances.removeAll(methodInvokerFilters);
        assertTrue(String.format("MethodInvoker filters %s expected but not found", expectedMethodInvokerFilterClassesOrInstances),
                   expectedMethodInvokerFilterClassesOrInstances.isEmpty());
    } else {
        List<Class> methodInvokerFiltersClasses = methodInvokerFilters.stream().map(Object::getClass).collect(toList());
        expectedMethodInvokerFilterClassesOrInstances.removeAll(methodInvokerFiltersClasses);
        assertTrue(String.format("MethodInvoker filters %s expected but not found", expectedMethodInvokerFilterClassesOrInstances),
                   expectedMethodInvokerFilterClassesOrInstances.isEmpty());
    }
}