@Test public void createClassThrowsProperErrorMsg() { DefaultObjectFactory defaultObjectFactory = new DefaultObjectFactory(); try { defaultObjectFactory.create(TestClass.class, Collections.<Class<?>>singletonList(String.class), Collections.<Object>singletonList("foo")); Assert.fail("Should have thrown ReflectionException"); } catch (Exception e) { Assert.assertTrue("Should be ReflectionException", e instanceof ReflectionException); Assert.assertTrue("Should not have trailing commas in types list", e.getMessage().contains("(String)")); Assert.assertTrue("Should not have trailing commas in values list", e.getMessage().contains("(foo)")); } }
@Override public <T> T create(Class<T> type) { return create(type, null, null); }
DefaultObjectFactory implements ObjectFactory, Serializable { @Override public <T> T create(Class<T> type) { return create(type, null, null); } }
DefaultObjectFactory implements ObjectFactory, Serializable { @Override public <T> T create(Class<T> type) { return create(type, null, null); }  }
DefaultObjectFactory implements ObjectFactory, Serializable { @Override public <T> T create(Class<T> type) { return create(type, null, null); }  @Override T create(Class<T> type); @SuppressWarnings("unchecked") @Override T create(Class<T> type, List<Class<?>> constructorArgTypes, List<Object> constructorArgs); @Override void setProperties(Properties properties); @Override boolean isCollection(Class<T> type); }
DefaultObjectFactory implements ObjectFactory, Serializable { @Override public <T> T create(Class<T> type) { return create(type, null, null); }  @Override T create(Class<T> type); @SuppressWarnings("unchecked") @Override T create(Class<T> type, List<Class<?>> constructorArgTypes, List<Object> constructorArgs); @Override void setProperties(Properties properties); @Override boolean isCollection(Class<T> type);  }