RestFunctions { @SuppressWarnings("unchecked") protected static RestConfig buildRestConfig(Map<String, Object>... configs) { RestConfig restConfig = new RestConfig(); for(Map<String, Object> config: configs) { if (config != null) { restConfig.putAll(config); } } return restConfig; }  static T getArg(int index, Class<T> clazz, List<Object> args);  }
@Test public void restShouldBuildRestConfig() { Map<String, Object> config = new HashMap<String, Object>() {{ put(BASIC_AUTH_USER, "user"); put(PROXY_BASIC_AUTH_USER, "proxyUser"); }}; Map<String, Object> priorityConfig = new HashMap<String, Object>() {{ put(BASIC_AUTH_USER, "priorityUser"); }}; RestConfig restConfig = RestFunctions.buildRestConfig(config, priorityConfig); assertEquals(6, restConfig.size()); assertEquals(Collections.singletonList(200), restConfig.getResponseCodesAllowed()); assertEquals("priorityUser", restConfig.getBasicAuthUser()); assertEquals("proxyUser", restConfig.getProxyBasicAuthUser()); assertTrue(restConfig.enforceJson()); assertEquals(1000, restConfig.getTimeout().intValue()); assertFalse(restConfig.verifyContentLength()); }