docs: private static boolean isMethodDefinedBySuperClass(Class<?> subclass, Class<?> superClass,
                                                         String methodName,
                                                         Class<?>[] methodParameters) {
          do {
              if (subclass == superClass) {
                  // The method is not overridden in the subclass or any class in between subClass
                  // and superClass.
                  return true;
              }
  
              try {
                  subclass.getDeclaredMethod(methodName, methodParameters);
  
                  // method is overridden is sub-class. hence the call could not have handled by
                  // the super-class.
                  return false;
              } catch (NoSuchMethodException e) {
                  subclass = subclass.getSuperclass();
              }
          } while (subclass != null);
  
          // Subclass is not a sub class of superClass
          return false;
      }