public <T> T instantiate(Class<T> entityClass) {
try {
return entityClass.newInstance();
} catch (InstantiationException e) {
throw new AchillesException("Cannot instantiate class of type " + entityClass.getCanonicalName()+", did you forget to declare a default constructor ?",e);
} catch (IllegalAccessException e) {
throw new AchillesException("Cannot instantiate class of type " + entityClass.getCanonicalName()+", did you forget to declare a default constructor ?",e);
}
}