// Path: src/main/java/hudson/plugins/analysis/util/Compatibility.java
// public final class Compatibility {
// 
//     /**
//      * Util.isOverridden does not work on non-public methods, that's why this one is used here.
//      */
//     public static boolean isOverridden(@Nonnull Class base, @Nonnull Class derived, @Nonnull String methodName, @Nonnull Class... types) {
//         try {
//             return !getMethod(base, methodName, types).equals(getMethod(derived, methodName, types));
//         } catch (NoSuchMethodException e) {
//             throw new AssertionError(e);
//         }
//     }
// 
//     private static Method getMethod(@Nonnull Class clazz, @Nonnull String methodName, @Nonnull Class... types) throws NoSuchMethodException {
//         Method res = null;
//         try {
//             res = clazz.getDeclaredMethod(methodName, types);
//         } catch (NoSuchMethodException e) {
//             // Method not found in clazz, let's search in superclasses
//             Class superclass = clazz.getSuperclass();
//             if (superclass != null) {
//                 res = getMethod(superclass, methodName, types);
//             }
//         } catch (SecurityException e) {
//             throw new AssertionError(e);
//         }
//         if (res == null) {
//             throw new NoSuchMethodException("Method " + methodName + " not found in " + clazz.getName());
//         }
//         return res;
//     }
// 
//     private Compatibility() {}
// }


import static org.junit.Assert.*;
import org.junit.Test;
import hudson.plugins.analysis.util.Compatibility;
package hudson.plugins.analysis.core;




/**
 * Test for {@link Compatibility.isOverridden} method.
 */
public class IsOverriddenTest {

    /**
     * Test that a method is found by isOverridden even when it is inherited from an intermediate class.
     */
    @Test
    public void isOverriddenTest() {
// Path: src/main/java/hudson/plugins/analysis/util/Compatibility.java
// public final class Compatibility {
// 
//     /**
//      * Util.isOverridden does not work on non-public methods, that's why this one is used here.
//      */
//     public static boolean isOverridden(@Nonnull Class base, @Nonnull Class derived, @Nonnull String methodName, @Nonnull Class... types) {
//         try {
//             return !getMethod(base, methodName, types).equals(getMethod(derived, methodName, types));
//         } catch (NoSuchMethodException e) {
//             throw new AssertionError(e);
//         }
//     }
// 
//     private static Method getMethod(@Nonnull Class clazz, @Nonnull String methodName, @Nonnull Class... types) throws NoSuchMethodException {
//         Method res = null;
//         try {
//             res = clazz.getDeclaredMethod(methodName, types);
//         } catch (NoSuchMethodException e) {
//             // Method not found in clazz, let's search in superclasses
//             Class superclass = clazz.getSuperclass();
//             if (superclass != null) {
//                 res = getMethod(superclass, methodName, types);
//             }
//         } catch (SecurityException e) {
//             throw new AssertionError(e);
//         }
//         if (res == null) {
//             throw new NoSuchMethodException("Method " + methodName + " not found in " + clazz.getName());
//         }
//         return res;
//     }
// 
//     private Compatibility() {}
// }


// Path: src/test/java/hudson/plugins/analysis/core/IsOverriddenTest.java
import static org.junit.Assert.*;
import org.junit.Test;
import hudson.plugins.analysis.util.Compatibility;

package hudson.plugins.analysis.core;




/**
 * Test for {@link Compatibility.isOverridden} method.
 */
public class IsOverriddenTest {

    /**
     * Test that a method is found by isOverridden even when it is inherited from an intermediate class.
     */
    @Test
    public void isOverriddenTest() {
        assertTrue(Compatibility.isOverridden(Base.class, Derived.class, "method"));