@@ -0,0 +1,1404 @@
+package equals;%0A%0Apublic class GetClassAndClassConstant %7B%0A%09%0A%09static class A %7B%0A%09%09int x;%0A%09%09public int hashCode() %7B%0A%09%09%09return x;%0A%09%09%7D%0A%09%09public boolean equals(Object o) %7B%0A%09%09%09if (o != null && A.class.equals(o.getClass()))%0A%09%09%09%09%09return x == ((A)o).x;%0A%09%09%09return false;%0A%09%09%09%09%0A%09%09%7D%0A%09%7D%0A%09static class B extends A %7B%0A%09%0A%09%7D%0A%09static class A2 %7B%0A%09%09int x;%0A%09%09public int hashCode() %7B%0A%09%09%09return x;%0A%09%09%7D%0A%09%09public boolean equals(Object o) %7B%0A%09%09%09if (o != null && A2.class.equals(o.getClass()))%0A%09%09%09%09%09return x == ((A2)o).x;%0A%09%09%09return false;%0A%09%09%09%09%0A%09%09%7D%0A%09%7D%0A%09static class B2 extends A2 %7B%0A%09%09public boolean equals(Object o) %7B%0A%09%09%09if (o != null && B2.class.equals(o.getClass()))%0A%09%09%09%09%09return x == ((B2)o).x;%0A%09%09%09return false;%0A%09%09%09%09%0A%09%09%7D%0A%09%0A%09%7D%0A%09static class C %7B%0A%09%09int x;%0A%09%09public int hashCode() %7B%0A%09%09%09return x;%0A%09%09%7D%0A%09%09public boolean equals(Object o) %7B%0A%09%09%09if (o != null && C.class.equals(o.getClass()))%0A%09%09%09%09%09return x == ((C)o).x;%0A%09%09%09return false;%0A%09%09%09%09%0A%09%09%7D%0A%09%7D%0A%09static final class D %7B%0A%09%09int x;%0A%09%09public int hashCode() %7B%0A%09%09%09return x;%0A%09%09%7D%0A%09%09public boolean equals(Object o) %7B%0A%09%09%09if (o != null && D.class.equals(o.getClass()))%0A%09%09%09%09%09return x == ((D)o).x;%0A%09%09%09return false;%0A%09%09%09%09%0A%09%09%7D%0A%09%7D%0A%09static class E %7B // OK, this is just stupid, but perhaps we should check for it%0A%09%09int x;%0A%09%09public int hashCode() %7B%0A%09%09%09return x;%0A%09%09%7D%0A%09%09public boolean equals(Object o) %7B%0A%09%09%09if (o != null && C.class.equals(o.getClass()))%0A%09%09%09%09%09return x == ((C)o).x;%0A%09%09%09return false;%0A%09%09%09%09%0A%09%09%7D%0A%09%7D%0A%09%0A%7D%0A

add test cases for equals that using class constant and getClass()