private static MethodDoc getMethodForType(ClassDoc classDoc, String nestedType) {
      notNull(classDoc, "classDoc");
      notNull(nestedType, "nestedType");

      MethodDoc result = null;
      MethodDoc[] methods = classDoc.methods();
      for (MethodDoc method : methods) {
        if (method.name().equalsIgnoreCase("add")||method.name().equalsIgnoreCase("addConfigured")) {
          com.sun.javadoc.Parameter[] params = method.parameters();
          if (params.length == 1) {
            // Ugly. I have the method, why can't Javadoc give me the comment directly?
            if (nestedType.endsWith(params[0].type().typeName())) { 
              result = method;
              break;
            }
          }
        }
      }
      if (result == null && classDoc.superclass() != null) {
        return getMethodForType(classDoc.superclass(), nestedType);
      }
      return result;
    }