code: public static <T> T getInstance(Class<T> clazz) throws IllegalAccessException, InstantiationException {
          if (!isInstantiated(clazz)) {
              T object = clazz.newInstance();
              getOrInstantiateClassObjectMap().put(clazz, object);
              return object;
          }
  
          //noinspection unchecked
          return (T) getOrInstantiateClassObjectMap().get(clazz);
      }
docs: Returns an instance of the specified class. If this method is called for the same class several times, the same instance will be returned every time.
  For this method to work, the class must have a public parameterless constructor.
  However, the constructor may call {@link #throwIllegalStateExceptionIfAlreadyInstantiated(Class)} to ensure that only one instance
  is created.
  
  @param clazz The class to return a type of
  @param <T>   The type of the class
  @return The instance of that class
  @throws IllegalAccessException if the class or its nullary constructor is not accessible.
  @throws InstantiationException if this Class represents an abstract class, an interface, an array class, a primitive type, or void; or if the class has no nullary constructor; or if the instantiation fails for some other reason