StudentClass implements Serializable { @Override public String toString() { return "{id:" + id + ", classId:" + classId + ", discipline:" + discipline + ", students:" + 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 shouldToString() throws Exception { StudentClass s1 = new StudentClass("GER101", Discipline.GERMAN, "001", "002"); Assert.assertEquals("s1.toString()" , "{id:0, classId:GER101, discipline:German, students:[001, 002]}", s1.toString()); }