docs: private static Class<?> getClass(Type type) {
          if (type instanceof Class) {
              return (Class<?>) type;
          } else if (type instanceof ParameterizedType) {
              return getClass(((ParameterizedType) type).getRawType());
          }
          throw new RuntimeException("Could not convert " + type + " to a class, it is a " + type.getClass());
      }