### Question:
TimeMathParser { public static int resolutionInSeconds(String resolutionStr) { Matcher matcher = RESOLUTION_PATTERN.matcher(resolutionStr); int output = 0; while (matcher.find()) { output += TimeUnit.MILLISECONDS.toSeconds(convertToMilliseconds(Long.parseLong(matcher.group(1)), matcher.group(2))); } return output; }  static long nowInSeconds(); static int resolutionInSeconds(String resolutionStr); static long parseTimeInSeconds(String timeStr); static long parseTime(String timeStr, TimeUnit timeUnit); static long parseTimeInSeconds(long now, String timeStr); static long parseTime(long now, String timeStr, TimeUnit timeUnit);  }### Answer:
@Test public void testResolutionParsing() { String resolution = "60s"; Assert.assertEquals(60, TimeMathParser.resolutionInSeconds(resolution)); resolution = "2m"; Assert.assertEquals(120, TimeMathParser.resolutionInSeconds(resolution)); resolution = "3h"; Assert.assertEquals(10800, TimeMathParser.resolutionInSeconds(resolution)); resolution = "1d"; Assert.assertEquals(86400, TimeMathParser.resolutionInSeconds(resolution)); resolution = "1h3m"; Assert.assertEquals(3780, TimeMathParser.resolutionInSeconds(resolution)); }