Main method to demonstrate problem in inheritance and equals