code: public static Class<?> getFirstTypeArgument(Type type) {
          if (type instanceof ParameterizedType) {
              ParameterizedType p = (ParameterizedType) type;
              return getRawClass(p.getActualTypeArguments()[0]);
          } else {
              return null;
          }
      }
docs: Get declared type parameter of the type has one.
  
  @param type type
  @return declared parameter class