### Question:
ExerciseKey { @Override public int hashCode() { return Objects.hash(courseName, exerciseName); } ExerciseKey(String courseName, String exerciseName); String getCourseName(); String getExerciseName(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void hashCodeIsSameIfObjectAreEqual() { ExerciseKey same = new ExerciseKey("a", "b"); assertEquals(ek.hashCode(), same.hashCode()); }
@Test public void hashcodeNotSameIfCourseOrExerciseIsNotSame() { ExerciseKey other1 = new ExerciseKey("a", "c"); ExerciseKey other2 = new ExerciseKey("c", "b"); assertFalse(ek.hashCode() == other1.hashCode()); assertFalse(ek.hashCode() == other2.hashCode()); }