code: protected static Type getTypeArgument(GenericType type, int index) {
          GenericType arg = type.getTypeArgument(index);
          if (arg != null) {
              return new Type(arg);
          }
  
          // unknown type, so return object
          return Type.OBJECT_TYPE;
      }
docs: Get the associated type of the generic type based on the generic type
  parameters.  If the type is not generic or has no resolvable type params,
  then {@link Type#OBJECT_TYPE} is returned.
  
  @param type  The generic type
  @param index  The index of the type argument
  
  @return  The element type