code: private <T extends ProgramElementDoc> void mapTypeParameters(Map<String,List<T>> map, Object doc,
              T holder) {
          TypeVariable[] typeVariables;
          if (doc instanceof ClassDoc) {
              typeVariables = ((ClassDoc) doc).typeParameters();
          } else if (doc instanceof WildcardType) {
              for (Type extendsBound : ((WildcardType) doc).extendsBounds()) {
                  addTypeParameterToMap(map, extendsBound, holder);
              }
              for (Type superBound : ((WildcardType) doc).superBounds()) {
                  addTypeParameterToMap(map, superBound, holder);
              }
              return;
          } else if (doc instanceof ParameterizedType) {
              for (Type typeArgument : ((ParameterizedType) doc).typeArguments()) {
                  addTypeParameterToMap(map, typeArgument, holder);
              }
              return;
          } else if (doc instanceof ExecutableMemberDoc) {
              typeVariables = ((ExecutableMemberDoc) doc).typeParameters();
          } else if (doc instanceof FieldDoc) {
              Type fieldType = ((FieldDoc) doc).type();
              mapTypeParameters(map, fieldType, holder);
              return;
          } else {
              return;
          }
          for (TypeVariable typeVariable : typeVariables) {
              for (Type bound : typeVariable.bounds()) {
                  addTypeParameterToMap(map, bound, holder);
              }
          }
      }
docs: Map the ClassDocs to the ProgramElementDocs that use them as
  type parameters.
  
  @param map the map the insert the information into.
  @param doc the doc whose type parameters are being checked.
  @param holder the holder that owns the type parameters.