EncodingFilter implements ContainerResponseFilter { SortedSet<String> getSupportedEncodings() { if (supportedEncodings == null) { SortedSet<String> se = new TreeSet<>(); List<ContentEncoder> encoders = injectionManager.getAllInstances(ContentEncoder.class); for (ContentEncoder encoder : encoders) { se.addAll(encoder.getSupportedEncodings()); } se.add(IDENTITY_ENCODING); supportedEncodings = se; } return supportedEncodings; }  @SafeVarargs static void enableFor(ResourceConfig rc, Class<? extends ContentEncoder>... encoders); @Override void filter(ContainerRequestContext request, ContainerResponseContext response);  }
@Test public void testNoInterceptor() { ResourceConfig rc = new ResourceConfig(EncodingFilter.class); ContainerResponseFilter filter = new ApplicationHandler(rc).getInjectionManager() .getInstance(ContainerResponseFilter.class); assertNotNull(filter); assertTrue(filter instanceof EncodingFilter); assertEquals(1, ((EncodingFilter) filter).getSupportedEncodings().size()); }