docs: public static <T> T instantiate(String type, Class<T> requiredType) {
          try {
              return ClassUtils.forName(type, requiredType.getClassLoader())
                  .flatMap((Function<Class, Optional<T>>) aClass -> {
                      if (requiredType == aClass || requiredType.isAssignableFrom(aClass)) {
                          return tryInstantiate(aClass);
                      }
                      return Optional.empty();
                  })
                  .orElseThrow(() -> new InstantiationException("No compatible class found for name: " + type));
          } catch (Throwable e) {
              throw new InstantiationException("Could not instantiate type [" + type + "]: " + e.getMessage(), e);
          }
      }