ConfigFactory { public static String setProperty(String key, String value) { return INSTANCE.setProperty(key, value); } 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 testSetProperty() { ConfigFactory.setProperty("mypath", RESOURCES_DIR); MyConfig cfg = ConfigFactory.create(MyConfig.class); assertEquals("foobar", cfg.someValue()); }
@Test(expected = IllegalArgumentException.class) public void testSetPropertyNullKey() { ConfigFactory.setProperty(null, "foobar"); }
@Test(expected = IllegalArgumentException.class) public void testSetPropertyEmptyKey() { ConfigFactory.setProperty("", "foobar"); }