code: private static Method getAccessibleMethodFromInterfaceNest(Class<?> cls,
              final String methodName, final Class<?>... parameterTypes) {
          // Search up the superclass chain
          for (; cls != null; cls = cls.getSuperclass()) {
  
              // Check the implemented interfaces of the parent class
              final Class<?>[] interfaces = cls.getInterfaces();
              for (final Class<?> anInterface : interfaces) {
                  // Is this interface public?
                  if (!Modifier.isPublic(anInterface.getModifiers())) {
                      continue;
                  }
                  // Does the method exist on this interface?
                  try {
                      return anInterface.getDeclaredMethod(methodName,
                              parameterTypes);
                  } catch (final NoSuchMethodException e) { // NOPMD
                      /*
                       * Swallow, if no method is found after the loop then this
                       * method returns null.
                       */
                  }
                  // Recursively check our parent interfaces
                  final Method method = getAccessibleMethodFromInterfaceNest(anInterface,
                          methodName, parameterTypes);
                  if (method != null) {
                      return method;
                  }
              }
          }
          return null;
      }
docs: <p>Returns an accessible method (that is, one that can be invoked via
  reflection) that implements the specified method, by scanning through
  all implemented interfaces and subinterfaces. If no such method
  can be found, return {@code null}.</p>
  
  <p>There isn't any good reason why this method must be {@code private}.
  It is because there doesn't seem any reason why other classes should
  call this rather than the higher level methods.</p>
  
  @param cls Parent class for the interfaces to be checked
  @param methodName Method name of the method we wish to call
  @param parameterTypes The parameter type signatures
  @return the accessible method or {@code null} if not found