code: public static Type getTypeParameter(Type type, TypeVariable<? extends Class<?>> variable) {
  		Class<?> clazz = variable.getGenericDeclaration();
  		Type superType = getExactSuperType(type, clazz);
  		if (superType instanceof ParameterizedType) {
  			int index = Arrays.asList(clazz.getTypeParameters()).indexOf(variable);
  			return ((ParameterizedType)superType).getActualTypeArguments()[index];
  		} else {
  			return null;
  		}
  	}
docs: Gets the type parameter for a given type that is the value for a given type variable.
  For example, with <tt>class StringList implements List&lt;String&gt;</tt>,
  <tt>getTypeParameter(StringList.class, Collection.class.getTypeParameters()[0])</tt>
  returns <tt>String</tt>.
  
  @param type The type to inspect.
  @param variable The type variable to find the value for.
  @return The type parameter for the given variable. Or null if type is not a subtype of the
  type that declares the variable, or if the variable isn't known (because of raw types).