public static <T>T instance(Class<T> clazz){
  try {
    return clazz.newInstance();
  }
 catch (  InstantiationException|IllegalAccessException e) {
    throw new IllegalStateException(e);
  }
}

public static < T > T instance ( Class < T > clazz ) { try { return clazz . newInstance ( ) ; } catch ( InstantiationException | IllegalAccessException e ) { throw new IllegalStateException ( e ) ; } }
creates a new instance of the class represented by the given class object
