### Question:
Time { public static org.joda.time.Duration parseDuration(String value) { return parseJodaDuration(value); }  static org.joda.time.Duration parseDuration(String value); static ValueProvider<org.joda.time.Duration> parseDuration(ValueProvider<String> value); static long parseSeconds(String value); static ValueProvider<Long> parseSeconds(ValueProvider<String> value); static Instant parseAsInstantOrNull(String timestamp); static String epochMicrosToTimestamp(Long epochMicros); static String epochNanosToTimestamp(Long epochNanos);  }### Answer:
@Test public void testParseDuration() { assertEquals(Time.parseDuration("13s").getMillis(), SECONDS.toMillis(13)); assertEquals(Time.parseDuration("4m").getMillis(), MINUTES.toMillis(4)); assertEquals(Time.parseDuration("1h").getMillis(), HOURS.toMillis(1)); assertEquals(Time.parseDuration("P2D").getMillis(), DAYS.toMillis(2)); }
@Test public void testExtendedParseDuration() { assertEquals(Time.parseDuration("5.5 seconds").getMillis(), 5500L); assertEquals(Time.parseDuration("5.5 SECONDS").getMillis(), 5500L); assertEquals(Time.parseDuration("1 hour").getMillis(), HOURS.toMillis(1)); assertEquals(Time.parseDuration("2 days").getMillis(), DAYS.toMillis(2)); assertEquals(Time.parseDuration("2 day 0.001 second").getMillis(), DAYS.toMillis(2) + 1L); assertEquals(Time.parseDuration("4m13s").getMillis(), MINUTES.toMillis(4) + SECONDS.toMillis(13)); assertEquals(Time.parseDuration("P2days").getMillis(), DAYS.toMillis(2)); }
@Test(expected = IllegalArgumentException.class) public void testParseDurationIllegalArgument() { Time.parseDuration("foo"); }
@Test public void testParseDurationValueProvider() { final ValueProvider<String> provider = StaticValueProvider.of("13s"); assertEquals(Time.parseDuration(provider).get().getMillis(), SECONDS.toMillis(13)); }
@Test(expected = IllegalArgumentException.class) public void testZeroThrows() { Time.parseDuration("0m"); }
@Test(expected = IllegalArgumentException.class) public void testNegativeThrows() { Time.parseDuration("-PT6H"); }