### Question:
ExerciseKey { @Override public boolean equals(Object obj) { if (obj instanceof ExerciseKey) { ExerciseKey that = (ExerciseKey) obj; return Objects.equals(this.courseName, that.courseName) && Objects.equals(this.exerciseName, that.exerciseName); } else { return false; } } ExerciseKey(String courseName, String exerciseName); String getCourseName(); String getExerciseName(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void notEqualIfCourseOrExerciseIsNotSame() { ExerciseKey other1 = new ExerciseKey("a", "c"); ExerciseKey other2 = new ExerciseKey("c", "b"); assertFalse(ek.equals(other1)); assertFalse(ek.equals(other2)); }
@Test public void notEqualOnNull() { assertFalse(ek.equals(null)); }
@Test public void notEqualWithOtherClasses() { assertFalse(ek.equals(new Integer(1))); }