Range implements Serializable { @Override public String toString() { return getClass().getSimpleName() + "[period=" + getPeriod() + ", startDate=" + getStartDate() + ", endDate=" + getEndDate() + ']'; } private  Range(Period period, Date startDate, Date endDate); static Range createCustomRange(Date startDate, Date endDate); static Range parse(String value, DateFormat dateFormat); Period getPeriod(); Date getStartDate(); Date getEndDate(); String getValue(); String getLabel(); @Override String toString(); static final char CUSTOM_PERIOD_SEPARATOR; }
@Test public void testToString() { final String string = periodRange.toString(); assertNotNull("toString not null", string); assertFalse("toString not empty", string.isEmpty()); final String string2 = customRange.toString(); assertNotNull("toString not null", string2); assertFalse("toString not empty", string2.isEmpty()); }