code: @Nullable
      private static Class<?> typeToClass(Type type) {
          if (type instanceof Class) {
              return (Class<?>) type;
          }
          if (type instanceof ParameterizedType) {
              return (Class<?>) ((ParameterizedType) type).getRawType();
          }
          return null;
      }
docs: Converts the specified {@link Type} to a {@link Class} instance.