### Question:
ConfigUtil { public static TimeRange getTimeRange(String startKey, String stopKey, Configuration config) { final Date startDate = config.getDateValue(startKey); final Date stopDate = config.getDateValue(stopKey); if (!stopDate.after(startDate)) { throw new ToolException("Configuration error: " + stopKey + " is before " + startKey, ToolException.TOOL_CONFIGURATION_ERROR); } return new TimeRange(startDate, stopDate); }  static String getUsecaseRootPath(Configuration config); static TimeRange getTimeRange(String startKey, String stopKey, Configuration config);  }### Answer:
@Test public void testGetTimeRange() throws ParseException { final Configuration config = new Configuration(); config.put("start", "1978-01-01T00:00:00Z"); config.put("stop", "1979-01-01T00:00:00Z"); final TimeRange timeRange = ConfigUtil.getTimeRange("start", "stop", config); assertNotNull(timeRange); final Date startDate = timeRange.getStartDate(); assertEquals(TimeUtil.parseCcsdsUtcFormat("1978-01-01T00:00:00Z").getTime(), startDate.getTime()); final Date stopDate = timeRange.getStopDate(); assertEquals(TimeUtil.parseCcsdsUtcFormat("1979-01-01T00:00:00Z").getTime(), stopDate.getTime()); }
@Test public void testGetTimeRange_throwsOnMissingStartValue() throws ParseException { final Configuration config = new Configuration(); config.put("stop", "1979-01-01T00:00:00Z"); try { ConfigUtil.getTimeRange("start", "stop", config); fail("ToolException expected"); } catch (ToolException expected) { } }
@Test public void testGetTimeRange_throwsOnMissingStopValue() throws ParseException { final Configuration config = new Configuration(); config.put("start", "1978-01-01T00:00:00Z"); try { ConfigUtil.getTimeRange("start", "stop", config); fail("ToolException expected"); } catch (ToolException expected) { } }
@Test public void testGetTimeRange_throwsWhenStopIsBeforeStart() throws ParseException { final Configuration config = new Configuration(); config.put("start", "1980-01-01T00:00:00Z"); config.put("stop", "1979-01-01T00:00:00Z"); try { ConfigUtil.getTimeRange("start", "stop", config); fail("ToolException expected"); } catch (ToolException expected) { assertEquals("Configuration error: stop is before start", expected.getMessage()); } }