code: public static <E extends Exception> ImmutableSet<ExecutableElement> methodsOn(
        TypeElement type,
        Elements elements,
        ErrorTypeHandling<E> errorTypeHandling) throws E {
      TypeElement objectType = elements.getTypeElement(Object.class.getCanonicalName());
      Map<Signature, ExecutableElement> objectMethods = Maps.uniqueIndex(
          methodsIn(objectType.getEnclosedElements()), Signature::new);
      SetMultimap<Signature, ExecutableElement> methods = LinkedHashMultimap.create();
      for (TypeElement supertype : getSupertypes(type, errorTypeHandling)) {
        for (ExecutableElement method : methodsIn(supertype.getEnclosedElements())) {
          Signature signature = new Signature(method);
          if (method.getEnclosingElement().equals(objectType)) {
            continue;  // Skip methods specified by Object.
          }
          if (objectMethods.containsKey(signature)
              && method.getEnclosingElement().getKind() == ElementKind.INTERFACE
              && method.getModifiers().contains(Modifier.ABSTRACT)
              && elements.overrides(method, objectMethods.get(signature), type)) {
            continue;  // Skip abstract methods on interfaces redelaring Object methods.
          }
          Iterator<ExecutableElement> iterator = methods.get(signature).iterator();
          while (iterator.hasNext()) {
            ExecutableElement otherMethod = iterator.next();
            if (elements.overrides(method, otherMethod, type)
                || method.getParameters().equals(otherMethod.getParameters())) {
              iterator.remove();
            }
          }
          methods.put(signature, method);
        }
      }
      return ImmutableSet.copyOf(methods.values());
    }
docs: Returns all methods, declared and inherited, on {@code type}, except those specified by
  {@link Object}.
  
  <p>If method B overrides method A, only method B will be included in the return set.
  Additionally, if methods A and B have the same signature, but are on unrelated interfaces,
  one will be arbitrarily picked to be returned.