code: public <T extends Entity<ID>, ID extends Serializable> T newInstance(final Class<T> clazz, final ID id) {
      EntityType type = getEntityType(clazz);
      @SuppressWarnings("unchecked")
      T entity = (T) type.newInstance();
      try {
        PropertyUtils.setProperty(entity, type.getIdName(), id);
      } catch (Exception e) {
        logger.error("initialize {} with id {} error", clazz, id);
      }
      return entity;
    }
docs: <p>
  newInstance.
  </p>
  
  @param clazz a {@link java.lang.Class} object.
  @param id a {@link java.io.Serializable} object.
  @param <T> a T object.
  @return a T object.