code: public static <T extends Executable> Predicate<T> executableIsEquivalentTo(T reference) {
          Predicate<T> predicate = candidate -> candidate != null
                  && candidate.getName().equals(reference.getName())
                  && executableHasSameParameterTypesAs(reference).test(candidate);
          if (reference instanceof Method) {
              predicate.and(candidate -> candidate instanceof Method && ((Method) candidate).getReturnType()
                      .equals(((Method) reference).getReturnType()));
          }
          return predicate;
      }
docs: Checks if a candidate executable is equivalent to the specified reference executable.
  
  @param reference the executable to check equivalency against.
  @return the predicate.