ConfigFactory { public static void setProperties(Properties properties) { INSTANCE.setProperties(properties); } private  ConfigFactory(); static Factory newInstance(); static T create(Class<? extends T> clazz, Map<?, ?>... imports); static String setProperty(String key, String value); static Properties getProperties(); static void setProperties(Properties properties); static String getProperty(String key); static String clearProperty(String key); static void registerLoader(Loader loader); static void setTypeConverter(Class<?> type, Class<? extends Converter<?>> converter); static void removeTypeConverter(Class<?> type);  }
@Test public void testSetProperties() { ConfigFactory.setProperties(new Properties() {{ setProperty("mypath", RESOURCES_DIR); }}); MyConfig cfg = ConfigFactory.create(MyConfig.class); assertEquals("foobar", cfg.someValue()); }