### Question:
TimeFactory { public static ITime createTime(String timeString) throws IllegalArgumentException { if (timeString.equals("now")) { TimePosition now = new TimePosition(timeString); return now; } if (timeString.contains("/")) { switch (timeString.split("/").length) { case 3: { TimePeriod period = new TimePeriod(timeString); return period; } case 2: { TimePeriod period = new TimePeriod(timeString.split("/")[0], timeString.split("/")[1]); return period; } default: throw new IllegalArgumentException("Time parameter is not in correct format"); } } return new TimePosition(timeString); }  static ITime createTime(String timeString);  }### Answer:
@Test public void createTimeValuesBeforeAtAndAfterDaylightSavingTimeSwitch() { String beforeSwitch = "2007-10-28T02:55:00.000+02:00"; String atSwitch = "2007-10-28T02:00:00.000+01:00"; String afterSwitch = "2007-10-28T02:05:00.000+01:00"; ITime oxfBeforeSwitch = TimeFactory.createTime(beforeSwitch); ITime oxfAtSwitch = TimeFactory.createTime(atSwitch); ITime oxfAfterSwitch = TimeFactory.createTime(afterSwitch); DateTime jodaBeforeSwitch = DateTime.parse(beforeSwitch); DateTime jodaAtSwitch = DateTime.parse(atSwitch); DateTime jodaAfterSwitch = DateTime.parse(afterSwitch); assertThat(jodaBeforeSwitch, is(DateTime.parse(oxfBeforeSwitch.toISO8601Format()))); assertThat(jodaAtSwitch, is(DateTime.parse(oxfAtSwitch.toISO8601Format()))); assertThat(jodaAfterSwitch, is(DateTime.parse(oxfAfterSwitch.toISO8601Format()))); }