@Test
public void testParse() throws ParseException {

  final Object[][] testParameters = new Object[][] {{"1ms", TimeUnit.NANOSECONDS, 1000000L},
      {"1ms", TimeUnit.MICROSECONDS, 1000L}, {"1ms", TimeUnit.MILLISECONDS, 1L},
      {"1ms", TimeUnit.SECONDS, 0L}, {"1ms", TimeUnit.MINUTES, 0L},
      {"1ms", TimeUnit.HOURS, 0L}, {"1ms", TimeUnit.DAYS, 0L},
      {"1s", TimeUnit.NANOSECONDS, 1000000000L}, {"1s", TimeUnit.MICROSECONDS, 1000000L},
      {"1s", TimeUnit.MILLISECONDS, 1000L}, {"1s", TimeUnit.SECONDS, 1L},
      {"1s", TimeUnit.MINUTES, 0L}, {"1s", TimeUnit.HOURS, 0L},
      {"1s", TimeUnit.DAYS, 0L}, {"1m", TimeUnit.NANOSECONDS, 60000000000L},
      {"1m", TimeUnit.MICROSECONDS, 60000000L}, {"1m", TimeUnit.MILLISECONDS, 60000L},
      {"1m", TimeUnit.SECONDS, 60L}, {"1m", TimeUnit.MINUTES, 1L},
      {"1m", TimeUnit.HOURS, 0L}, {"1m", TimeUnit.DAYS, 0L}};
  for (final Object[] testParameter : testParameters) {
    long expected = (Long) testParameter[2];
    String val = (String) testParameter[0];
    TimeUnit unit = (TimeUnit) testParameter[1];
    assertEquals(expected, ParsingUtils.parse(val, unit));
  }
}