code: static <T> T getInstance(Class<T> clazz) {
          @SuppressWarnings("unchecked")
          final T casted = (T) instanceCache.computeIfAbsent(clazz, type -> {
              try {
                  return getInstance0(clazz);
              } catch (Exception e) {
                  throw new IllegalStateException("A class must have an accessible default constructor: " +
                                                  clazz.getName(), e);
              }
          });
          return casted;
      }
docs: Returns a cached instance of the specified {@link Class}.