Grade implements Serializable { @Override public String toString() { return "Grade [id=" + getId() + ", studentId=" + studentId + ", date=" + date + ", discipline=" + discipline + "]"; } 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 shouldToString() throws Exception { DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); Date date = dateFormat.parse("2013-12-4"); Grade g1 = new Grade("0001", date, Discipline.BIOLOGY, 40); Assert.assertTrue("g1.toString()" , g1.toString().contains("Grade [id=0, studentId=0001, date=Wed Dec 04 00:00:00")); }