StudentClass implements Serializable { @Override public boolean equals(final Object obj) { if (obj == null || getClass() != obj.getClass()) { return false; } final StudentClass other = (StudentClass) obj; return Objects.equals(this.classId, other.classId) && Objects.equals(this.discipline, other.discipline) && Objects.equals(this.students, other.students); } StudentClass(final String classId, final Discipline discipline);  StudentClass(final String classId, final Discipline discipline, List<String> students);  StudentClass(final String classId, final Discipline discipline, String... students);  StudentClass(); @Override int hashCode(); @Override boolean equals(final Object obj); @Override String toString(); final Discipline getDiscipline(); final void setDiscipline(final Discipline pDiscipline); final long getId(); String getClassId(); void setClassId(String classId); List<String> getStudents(); void setStudents(List<String> students); void setId(long id);  }
@Test public void shouldTestNotEq() { StudentClass s1 = new StudentClass("GER101", Discipline.GERMAN, "001", "002"); StudentClass s2 = new StudentClass("GER102", Discipline.GERMAN, "001", "002"); Assert.assertFalse("s1=s2", s1.equals(s2)); s1 = new StudentClass("GER101", Discipline.GERMAN, "001", "002"); s2 = new StudentClass("GER101", Discipline.FRENCH, "001", "002"); Assert.assertFalse("s1=s2", s1.equals(s2)); s1 = new StudentClass("GER101", Discipline.GERMAN, "001", "002"); s2 = new StudentClass("GER101", Discipline.GERMAN, "001", "003"); Assert.assertFalse("s1=s2", s1.equals(s2)); }