StopTimeFieldMappingFactory implements FieldMappingFactory { public static int getStringAsSeconds(String value) { Matcher m = _pattern.matcher(value); if (!m.matches()) throw new InvalidStopTimeException(value); try { int hours = Integer.parseInt(m.group(1)); int minutes = Integer.parseInt(m.group(2)); int seconds = Integer.parseInt(m.group(3)); return seconds + 60 * (minutes + 60 * hours); } catch (NumberFormatException ex) { throw new InvalidStopTimeException(value); } }  FieldMapping createFieldMapping(EntitySchemaFactory schemaFactory,
      Class<?> entityType, String csvFieldName, String objFieldName,
      Class<?> objFieldType, boolean required); static String getSecondsAsString(int t); static int getStringAsSeconds(String value);  }
@Test public void testGetStringAsSeconds() { assertEquals(0, getStringAsSeconds("00:00:00")); assertEquals(0, getStringAsSeconds("-00:00:00")); assertEquals(60, getStringAsSeconds("00:01:00")); assertEquals(60, getStringAsSeconds("-00:01:00")); assertEquals(3660, getStringAsSeconds("01:01:00")); assertEquals(-3540, getStringAsSeconds("-01:01:00")); assertEquals(37230, getStringAsSeconds("10:20:30")); assertEquals(-34770, getStringAsSeconds("-10:20:30")); assertEquals(360913, getStringAsSeconds("100:15:13")); assertEquals(-359087, getStringAsSeconds("-100:15:13")); try { getStringAsSeconds(""); fail(); } catch (InvalidStopTimeException ex) { } try { getStringAsSeconds("000000"); fail(); } catch (InvalidStopTimeException ex) { } try { getStringAsSeconds("00:00"); fail(); } catch (InvalidStopTimeException ex) { } try { getStringAsSeconds("--00:00:00"); fail(); } catch (InvalidStopTimeException ex) { } }