code: Collection<Method> getMethodAndInterfaceDeclarations(Method method, Collection<Class> interfaces) {
          final List<Method> methods = new ArrayList<>();
          methods.add(method);
  
          // we search for matching method by iteration and comparison vs getMethod to avoid repeated NoSuchMethodException
          // being thrown, while interface typically only define a few set of methods to check.
          interfaces.stream()
                  .map(Class::getMethods)
                  .flatMap(Arrays::stream)
                  .filter(m -> m.getName().equals(method.getName()) && Arrays.equals(m.getParameterTypes(), method.getParameterTypes()))
                  .findFirst()
                  .ifPresent(methods::add);
  
          return methods;
      }
docs: Returns initial {@link Method} as well as all matching ones found in interfaces.
  This allows to introspect metadata for a method which is both declared in parent class and in implemented
  interface(s). <code>interfaces</code> typically is obtained by {@link ClassUtils#getAllInterfacesAsSet}