public static Method getOverridingMethod ( final Method overridingMethod , final Class subclass ) { Class current = subclass ; while ( ! current . equals ( overridingMethod . getDeclaringClass ( ) ) ) { try { return current . getDeclaredMethod ( overridingMethod . getName ( ) , overridingMethod . getParameterTypes ( ) ) ; } catch ( NoSuchMethodException e ) { current = current . getSuperclass ( ) ; } } return null ; }
Traverses the class hierarchy upwards starting at the given subclass looking for an override of the given methods - > finds the bottom most override of the given method if any exists