docs: public static Method[] getUniqueDeclaredMethods(Class<?> leafClass) throws IllegalArgumentException {
          final List<Method> methods = new ArrayList<Method>(32);
          doWithMethods(leafClass, new MethodCallback() {
              @Override
              public void doWith(Method method) {
                  boolean knownSignature = false;
                  Method methodBeingOverriddenWithCovariantReturnType = null;
                  for (Method existingMethod : methods) {
                      if (method.getName().equals(existingMethod.getName()) &&
                              Arrays.equals(method.getParameterTypes(), existingMethod.getParameterTypes())) {
                          // Is this a covariant return type situation?
                          if (existingMethod.getReturnType() != method.getReturnType() &&
                                  existingMethod.getReturnType().isAssignableFrom(method.getReturnType())) {
                              methodBeingOverriddenWithCovariantReturnType = existingMethod;
                          } else {
                              knownSignature = true;
                          }
                          break;
                      }
                  }
                  if (methodBeingOverriddenWithCovariantReturnType != null) {
                      methods.remove(methodBeingOverriddenWithCovariantReturnType);
                  }
                  if (!knownSignature) {
                      methods.add(method);
                  }
              }
          });
          return methods.toArray(new Method[methods.size()]);
      }