### Question:
Step { @Override public boolean equals(Object other) { if (other instanceof Step) { final Step o = (Step) other; return o.getX() == x && o.getY() == y; } return false; } Step(int x, int y); int getX(); int getY(); @Override int hashCode(); @Override boolean equals(Object other);  }### Answer:
@Test void testEquals() { final Step step = new Step(0, 1); assertEquals(step, step); assertEquals(step, new Step(0, 1)); assertNotEquals(step, null); assertNotEquals(step, new Object()); assertNotEquals(step, new Step(0, 0)); assertNotEquals(step, new Step(1, 1)); assertNotEquals(step, new Step(1, 0)); }