@Override
    public void filter(ContainerRequestContext requestContext) throws IOException {
        if (resourceInfo.getResourceMethod().isAnnotationPresent(SupportedSearchVersion.class) ||
                resourceInfo.getResourceMethod().isAnnotationPresent(SupportedSearchVersions.class)) {
            checkVersion(resourceInfo.getResourceMethod().getAnnotationsByType(SupportedSearchVersion.class));
        } else if (resourceInfo.getResourceClass().isAnnotationPresent(SupportedSearchVersion.class) ||
                resourceInfo.getResourceClass().isAnnotationPresent(SupportedSearchVersions.class)) {
            checkVersion(resourceInfo.getResourceClass().getAnnotationsByType(SupportedSearchVersion.class));
        }
    }
@Test
    public void testFilterOnClass() throws Exception {
        final Method resourceMethod = TestResourceWithClassAnnotation.class.getMethod("methodWithoutAnnotation");
        final Class resourceClass = TestResourceWithClassAnnotation.class;
        when(resourceInfo.getResourceMethod()).thenReturn(resourceMethod);
        when(resourceInfo.getResourceClass()).thenReturn(resourceClass);
        when(versionProvider.get()).thenReturn(openSearchV1);

        filter.filter(requestContext);

        verify(versionProvider, times(1)).get();
    }