@Override
    public void configure(ResourceInfo resourceInfo, FeatureContext context) {
        final Method resourceMethod = resourceInfo.getResourceMethod();
        final Class resourceClass = resourceInfo.getResourceClass();
        if ((resourceMethod != null && (resourceMethod.isAnnotationPresent(SupportedSearchVersion.class)
                || resourceMethod.isAnnotationPresent(SupportedSearchVersions.class)))
                || (resourceClass != null && (resourceClass.isAnnotationPresent(SupportedSearchVersion.class)
                || resourceClass.isAnnotationPresent(SupportedSearchVersions.class)))) {
            context.register(SupportedSearchVersionFilter.class);
        }
    }
@Test
    public void configureRegistersResponseFilterIfAnnotationIsPresentOnBoth() throws Exception {
        final Class clazz = TestResourceWithClassAnnotation.class;
        when(resourceInfo.getResourceClass()).thenReturn(clazz);
        final Method method = TestResourceWithMethodAnnotation.class.getMethod("methodWithAnnotation");
        when(resourceInfo.getResourceMethod()).thenReturn(method);

        supportedSearchVersionDynamicFeature.configure(resourceInfo, featureContext);

        verify(featureContext, only()).register(SupportedSearchVersionFilter.class);
    }