LinuxSyslogYearSetter { @Override public String toString() { String str = ""; str += " source=" + m_source; str += " year=" + m_currentYear; str += " lastSeenMessage=" + DateTimeUtils.timestampToHumanDateAndTimeAndStampUTC(m_lastSeenMessageDate.getMillis()); return str; } LinuxSyslogYearSetter(String source, int startingYear); static LinuxSyslogYearSetter getYearSetter(String source); final void setYear(int startingYear); final int getDesiredYear(DateTime currentMessageDate); @Override String toString();  }
@Test public void testToString() { String source = "aSource"; int nineties = 1990; lsys = new LinuxSyslogYearSetter(source, nineties); DateTimeZone dtz = DateTimeZone.forID("America/New_York"); DateTime dt = new DateTime(0L, dtz); lsys.getDesiredYear(dt); String actual = lsys.toString(); assertEquals("Testing toString output "," source="+ source + " year="+ nineties + " lastSeenMessage=1 Jan 1991 00:00:00(662688000000)", actual); }