Grade implements Serializable { @Override public boolean equals(final Object obj) { if (obj == null || getClass() != obj.getClass()) { return false; } final Grade other = (Grade) obj; return Objects.equals(this.studentId, other.studentId) && Objects.equals(this.date, other.date) && Objects.equals(this.discipline, other.discipline) && Objects.equals(this.grade, other.grade); } Grade(final String studentId, final Date date, final Discipline discipline, final Integer grade);  Grade(); @Override int hashCode(); @Override boolean equals(final Object obj); @Override String toString(); final Discipline getDiscipline(); final void setDiscipline(final Discipline pDiscipline); final Integer getGrade(); final void setGrade(final Integer pGrade); final long getId(); String getStudentId(); void setStudentId(String studentId); Date getDate(); void setDate(Date date);  }
@Test public void shouldTestNotEq() throws InterruptedException { Grade g1 = new Grade("0001", new Date(), Discipline.BIOLOGY, 40); Assert.assertFalse(g1.equals(null)); Thread.sleep(3); Grade g2 = new Grade("0001", new Date(), Discipline.BIOLOGY, 40); Assert.assertFalse("g1!=g2", g1.equals(g2)); }