### Question:
Timeslot { @Override public String toString() { String endToConcatenate = end != null ? " - " + end : ""; return start + endToConcatenate; } @JsonCreator  Timeslot(@JsonProperty("start") String start, @JsonProperty("end") String end);  Timeslot(String start); String getStart(); String getEnd(); @Override String toString();  }### Answer:
@Test public void shouldFormatStringForTimeslotWithStartAndEnd() { Timeslot timeslot = new Timeslot("15:30", "16:15"); String formatedTimeslot = timeslot.toString(); assertEquals("15:30 - 16:15", formatedTimeslot); }
@Test public void shouldFormatStringForTimeslotWithOnlyStart() { Timeslot timeslot = new Timeslot("15:30"); String formatedTimeslot = timeslot.toString(); assertEquals("15:30", formatedTimeslot); }