@Test
public void validDocumentId() throws Throwable {

    assertTrue(UriUtils.isValidDocumentId(UriUtils.URI_LEGAL_CHARS, "/foo"));
    assertTrue(isValidUri(UriUtils.URI_LEGAL_CHARS));
    String testId = "/t/e/s/t";
    assertFalse(UriUtils.isValidDocumentId(testId, "/foo"));
    testId = "/foo/t/e/s/t";
    assertFalse(UriUtils.isValidDocumentId(testId, "/foo"));
    testId = "/foo/test";
    assertTrue(UriUtils.isValidDocumentId(testId, "/foo"));
    testId = "/test";
    assertTrue(UriUtils.isValidDocumentId(testId, "/foo"));
    testId = "{{test}}";
    assertEquals(UriUtils.isValidDocumentId(testId, "/foo"),
            isValidUri(testId));
    assertFalse(UriUtils.isValidDocumentId(testId, "/foo"));
    testId = "test:123123";
    assertEquals(UriUtils.isValidDocumentId(testId, "/foo"),
            isValidUri(testId));
    testId = "123:123123";
    assertTrue(UriUtils.isValidDocumentId(testId, "/foo"));
    testId = UriUtils.URI_LEGAL_CHARS;
    assertEquals(UriUtils.isValidDocumentId(testId, "/foo"),
            isValidUri(testId));
    testId = "/foo/";
    assertFalse(UriUtils.isValidDocumentId(testId, "/foo"));
}