TeradataTimePeriodParseDelegate { public static Object parse(String s) throws Exception { System.out.println("TeradataTimePeriodParseDelegate: parse: s: " + s); String[] periodParts = s.split(","); Time timeFrom = Time.valueOf(periodParts[0]); Time timeTo = Time.valueOf(periodParts[1]); Object[] data = { timeFrom, timeTo }; return new TeradataTimePeriod(data); }  static Object parse(String s);  }
@Test public void parseTest() { String fromStr = "01:23:45"; String toStr = "12:13:14"; Time fromTime = Time.valueOf(fromStr); Time toTime = Time.valueOf(toStr); Time[] range = {fromTime, toTime}; TeradataTimePeriod tp = new TeradataTimePeriod(range); TeradataTimePeriod tp2 = null; try { tp2 = (TeradataTimePeriod) TeradataTimePeriodParseDelegate.parse(fromStr + "," + toStr); } catch (Exception e) { throw new Error("During TeradataTimePeriodParseDelegate.parse(" + fromStr + "," + toStr + ")"); } assertTrue("Time period parse does not produce expected object", tp.equals(tp2)); }