Added an if/else statement to test that the override of the equals() method works correctly