assertThat(path1.hasSameAncestor(path2), is(false));
}
@Test
public void shouldConsiderAncestorToBeAtOrAboveTheDecendant() {
Path path1 = pathFactory.create("/a/y/z");
Path path2 = pathFactory.create("/a/b/c");
Path path3 = pathFactory.create("/x/b/c");
Path path4 = pathFactory.create("/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z");
for (int i = 1; i < path1.size(); ++i) {
assertThat(path1.getAncestor(i).isAtOrAbove(path1), is(true));
}
for (int i = 1; i < path2.size(); ++i) {
assertThat(path2.getAncestor(i).isAtOrAbove(path2), is(true));
}
for (int i = 1; i < path3.size(); ++i) {
assertThat(path3.getAncestor(i).isAtOrAbove(path3), is(true));
}
for (int i = 1; i < path4.size(); ++i) {
assertThat(path4.getAncestor(i).isAtOrAbove(path4), is(true));
}
}