* Test for issue 8654.
*/
public void testOverride() {
Caller aCaller = new Caller();
assertEquals("SomeParentParent", aCaller.callPackagePrivatem(new SomeParentParent()));
assertEquals("SomeParent", aCaller.callPackagePrivatem(new SomeParent()));
assertEquals("SomeParent", aCaller.callPackagePrivatem(
new SomeSubClassInAnotherPackage()));
assertEquals("SomeSubClassInAnotherPackage",
SomeSubClassInAnotherPackage.pleaseCallm(new SomeSubClassInAnotherPackage()));
assertEquals("SomeSubSubClassInAnotherPackage",
SomeSubClassInAnotherPackage.pleaseCallm(new SomeSubSubClassInAnotherPackage()));
assertEquals("ClassExposingM",
aCaller.callPackagePrivatem(new ClassExposingM()));
SomeInterface i = new ClassExposingM();
assertEquals("ClassExposingM", i.m());
assertEquals("live at ClassExposingM", new ClassExposingM().f());
// Confirm that both calling m through SomeInterface and through SomeParentParentParent
// dispatch to the right implementation.
SomeInterface i1 = new SubClassExposingM();
assertEquals("SubClassExposingM", i1.m());
assertEquals("SubClassExposingM",
SomeParentParentParent.callSomeParentParentParentM(new SubClassExposingM()));
assertEquals("SomeParentParentParent",
SomeParentParentParent.callSomeParentParentParentM(new SomeParentParentParent()));
assertEquals("SomeParentParentParent",
SomeParentParentParent.callSomeParentParentParentM(new SomePackageConfusedParent()));
assertEquals("SomeParentParent",
SomeParentParentParent.callSomeParentParentParentM(new SomeParentParent()));
assertEquals("SomeParent",
SomeParentParentParent.callSomeParentParentParentM(new SomeParent()));
assertEquals("SomeParent",
SomeParentParentParent.callSomeParentParentParentM(new SomeSubClassInAnotherPackage()));
assertEquals("SomeParent",
SomeParentParentParent.callSomeParentParentParentM(new SomeSubSubClassInAnotherPackage()));
}