equals and hashCode method must be consistent, which means that when two objects are equal according to equals method their hash
As others have already pointed out it the methods "equals" and the "hashCode" serve different purposes.
From the specification of hashCode method in Objectone can infer that:
Your code (taking into consideration the change tgamblin has proposed) satisfies criteria (a) hence you get the output as "EQUALS".
But is a good practice to follow (b) as this results in better performance when instance of the class are used as hashtable keys. When unequal objects return the same hashCode and if such a class is used as hashtable key, then every object hashes to the same bucket, and hashtable would degenerate to a linkedlist leading to reduced performance.