code: public static <T> T newInstance(Class<T> clazz) {
      // TODO(yanivi): investigate "sneaky" options for allocating the class that GSON uses, like
      // setting the constructor to be accessible, or possibly provide a factory method of a special
      // name
      try {
        return clazz.newInstance();
      } catch (IllegalAccessException e) {
        throw handleExceptionForNewInstance(e, clazz);
      } catch (InstantiationException e) {
        throw handleExceptionForNewInstance(e, clazz);
      }
    }
docs: Creates a new instance of the given class by invoking its default constructor.
  
  <p>The given class must be public and must have a public default constructor, and must not be
  an array or an interface or be abstract. If an enclosing class, it must be static.