class Archaius2Ext {

    public static <C> C newConfiguration(Class<C> configType, String... keyValuePairs) {
        if (keyValuePairs.length == 0) {
            return DEFAULT_CONFIG_PROXY_FACTORY.newProxy(configType);
        }

        Preconditions.checkArgument(keyValuePairs.length % 2 == 0, "Expected even number of arguments");

        Map<String, String> props = new HashMap<>();
        int len = keyValuePairs.length / 2;
        for (int i = 0; i < len; i++) {
            props.put(keyValuePairs[i * 2], keyValuePairs[i * 2 + 1]);
        }
        Config config = new MapConfig(props);
        return newConfiguration(configType, config);
    }

}