RESTEasyUtil { public static List<Class<?>> getProviderClasses(Map<String, String> contextParams) { List<String> providers = getParamValues(contextParams, ResteasyContextParameters.RESTEASY_PROVIDERS); if (providers != null) { List<Class<?>> providerClasses = new ArrayList<Class<?>>(providers.size()); for (String provider : providers) { Class<?> pc = Classes.forName(provider.trim()); if (pc != null) { providerClasses.add(pc); } } return providerClasses.isEmpty() ? null : providerClasses; } return null; } private  RESTEasyUtil(); static List<String> getParamValues(Map<String, String> contextParams, String paramName); static List<Class<?>> getProviderClasses(Map<String, String> contextParams); static Map<Class<?>, Class<?>> getExceptionProviderMap(Map<String, String> contextParams); static List<ClientErrorInterceptor> getClientErrorInterceptors(Map<String, String> contextParams); static String mediaTypeToString(MediaType type);  }
@Test public void testGetProviderClasses() throws Exception { Assert.assertNull(RESTEasyUtil.getProviderClasses(null)); Assert.assertNull(RESTEasyUtil.getProviderClasses(contextParams)); Assert.assertNull(RESTEasyUtil.getProviderClasses(contextParamsWithOnlyBadProviders)); List<Class<?>> providerClasses = RESTEasyUtil.getProviderClasses(contextParamsWithProviders); Assert.assertEquals(1, providerClasses.size()); Assert.assertEquals(String.class, providerClasses.get(0)); }