@Test
public void duration() {

  assertTrue(new UriTokenizer("duration'P'").next(TokenKind.DurationValue));
  assertTrue(new UriTokenizer("DURATION'P1D'").next(TokenKind.DurationValue));
  assertTrue(new UriTokenizer("duration'PT'").next(TokenKind.DurationValue));
  assertTrue(new UriTokenizer("duration'PT1H'").next(TokenKind.DurationValue));
  assertTrue(new UriTokenizer("duration'pt1M'").next(TokenKind.DurationValue));
  assertTrue(new UriTokenizer("duration'PT1S'").next(TokenKind.DurationValue));
  assertTrue(new UriTokenizer("duration'PT1.2s'").next(TokenKind.DurationValue));
  assertTrue(new UriTokenizer("duration'-p1dt2h3m4.5s'").next(TokenKind.DurationValue));
  assertFalse(new UriTokenizer("-p1dt2h3m4.5s").next(TokenKind.DurationValue));
  assertFalse(new UriTokenizer("duration'-p1dt2h3m4.5s").next(TokenKind.DurationValue));
  assertFalse(new UriTokenizer("duration'2h3m4s'").next(TokenKind.DurationValue));
  wrongToken(TokenKind.DurationValue, "duration'P1DT2H3M4.5S'", ':');
}