DefaultModelFactory { public static ModelFactory instance() { InputStream is = DefaultModelFactory.class.getResourceAsStream("factory.properties"); String className = "org.drugis.mtc.yadas.YadasModelFactory"; if (is != null) { try { Properties props = new Properties(); props.load(is); is.close(); className = props.getProperty("defaultModelFactory"); } catch (IOException e) { } } return instance(className); }  static ModelFactory instance(); static ModelFactory instance(String className);  }
@Test public void testDefaultInstance() throws Exception { ModelFactory fac = DefaultModelFactory.instance(); assertEquals(Class.forName(YADAS), fac.getClass()); }
@Test public void testOtherInstance() throws Exception { ModelFactory fac = DefaultModelFactory.instance(YADAS); assertEquals(Class.forName(YADAS), fac.getClass()); }