@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()); }
@Override public int hashCode() { return Objects.hash(courseName, exerciseName); }
ExerciseKey { @Override public int hashCode() { return Objects.hash(courseName, exerciseName); } }
ExerciseKey { @Override public int hashCode() { return Objects.hash(courseName, exerciseName); } ExerciseKey(String courseName, String exerciseName); }
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(); }
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();  }