  @Test
  public void testCanonicalizeName() {

    assertGraphNameEquals("", GraphName.of(""));
    assertGraphNameEquals("/", GraphName.of("/"));
    assertGraphNameEquals("/", GraphName.of("//"));
    assertGraphNameEquals("/", GraphName.of("///"));

    assertGraphNameEquals("foo", GraphName.of("foo"));
    assertGraphNameEquals("foo", GraphName.of("foo/"));
    assertGraphNameEquals("foo", GraphName.of("foo//"));

    assertGraphNameEquals("/foo", GraphName.of("/foo"));
    assertGraphNameEquals("/foo", GraphName.of("/foo/"));
    assertGraphNameEquals("/foo", GraphName.of("/foo//"));

    assertGraphNameEquals("/foo/bar", GraphName.of("/foo/bar"));
    assertGraphNameEquals("/foo/bar", GraphName.of("/foo/bar/"));
    assertGraphNameEquals("/foo/bar", GraphName.of("/foo/bar//"));

    assertGraphNameEquals("~foo", GraphName.of("~foo"));
    assertGraphNameEquals("~foo", GraphName.of("~foo/"));
    assertGraphNameEquals("~foo", GraphName.of("~foo//"));
    assertGraphNameEquals("~foo", GraphName.of("~/foo"));
  }