@Test
public void subpaths() {

    final String[] e1 = new String[] { "1", "2", "3", "4" };
    final String[] e2 = new String[] { "1", "2" };
    final CloudnamePath first = new CloudnamePath(e1);
    final CloudnamePath second = new CloudnamePath(e2);
    final CloudnamePath last = new CloudnamePath(twoElements);
    assertThat("More specific paths can't be subpaths", first.isSubpathOf(second), is(false));
    assertThat("More generic paths are subpaths", second.isSubpathOf(first), is(true));
    assertThat("A path can be subpath of itself", first.isSubpathOf(first), is(true));
    assertThat("Paths must match at root levels", last.isSubpathOf(second), is(false));
    assertThat("Null paths are not subpaths of anything", first.isSubpathOf(null), is(false));
    final CloudnamePath empty = new CloudnamePath(emptyElements);
    assertThat("An empty path is a subpath of everything", empty.isSubpathOf(first), is(true));
    assertThat("Empty paths can't have subpaths", first.isSubpathOf(empty), is(false));
}