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); }  static Supplier<List<Duration>> asDurationList(Supplier<String> configSupplier); static Flux<T> watch(Property<T> property); static Flux<T> watch(PropertyRepository propertyRepository, String key, Class<T> type); static C newConfiguration(Class<C> configType, String... keyValuePairs); static C newConfiguration(Class<C> configType, Map<String, String> properties); static C newConfiguration(Class<C> configType, Config config); static C newConfiguration(Class<C> configType, String prefix, Config config); static C newConfiguration(Class<C> configType, Environment environment); static C newConfiguration(Class<C> configType, String prefix, Environment environment); static ObjectConfigurationResolver<OBJECT, CONFIG> newObjectConfigurationResolver(
            Config configuration,
            Function<OBJECT, String> selectorFieldAccessor,
            Class<CONFIG> configType,
            CONFIG defaultConfig); static CloseableReference<ObjectConfigurationResolver<OBJECT, CONFIG>> newObjectConfigurationResolver(
            String prefix,
            Environment environment,
            Function<OBJECT, String> selectorFieldAccessor,
            Class<CONFIG> configType,
            CONFIG defaultConfig,
            Flux<Long> updateTrigger); static String toString(Config config);  }
@Test public void testConfiguration() { assertThat(Archaius2Ext.newConfiguration(MyConfig.class).getString()).isEqualTo("hello"); }
@Test public void testConfigurationWithOverrides() { assertThat(Archaius2Ext.newConfiguration(MyConfig.class, "string", "overridden").getString()).isEqualTo("overridden"); }
@Test public void testConfigurationWithNoPrefix() { MapConfig config = new MapConfig(Collections.singletonMap("string", "HELLO")); assertThat(Archaius2Ext.newConfiguration(MyConfig.class, config).getString()).isEqualTo("HELLO"); }
@Test public void testConfigurationWithPrefix() { MapConfig config = new MapConfig(Collections.singletonMap("root.string", "HELLO")); assertThat(Archaius2Ext.newConfiguration(MyConfig.class, "root", config).getString()).isEqualTo("HELLO"); }