docs: public static Optional<Class> resolveInterfaceTypeArgument(Class type, Class interfaceType) {
          Type[] genericInterfaces = type.getGenericInterfaces();
          for (Type genericInterface : genericInterfaces) {
              if (genericInterface instanceof ParameterizedType) {
                  ParameterizedType pt = (ParameterizedType) genericInterface;
                  if (pt.getRawType() == interfaceType) {
                      return resolveSingleTypeArgument(genericInterface);
                  }
              }
          }
          Class superClass = type.getSuperclass();
          if (superClass != null && superClass != Object.class) {
              return resolveInterfaceTypeArgument(superClass, interfaceType);
          }
          return Optional.empty();
      }