code: public static Object instantiate(MetadataBase metadata) {
      try {
        return metadata.getConstructorMetadata().getConstructorMethodHandle().invoke();
      } catch (Throwable t) {
        throw new EntityManagerException(t);
      }
    }
docs: Creates and returns a new instance of a persistence class for the given metadata. The returned
  object will be an instance of the primary persistence class or its Builder.
  
  @param metadata
  the metadata of the class
  @return a new instance of the of the Class to which the given metadata belongs.
  @throws EntityManagerException
  if any error occurs during instantiation.