public Path getParentPath() {
        ArrayList<String> parentElements = new ArrayList<>();
        if (elements.size() > 1) {
            for (int i = 0; i < elements.size() - 1; i++) {
                parentElements.add(elements.get(i));
            }
        }
        return new Path(parentElements, delimiter);
    }
@Test
    public void testGetParentPath() {
        assertEquals("foo/bar", getAbsolutePath().getParentPath().getRelative());
        assertEquals("foo/bar", getRelativePath().getParentPath().getRelative());
        assertEquals("foo/bar", getWithSlashes().getParentPath().getRelative());
        assertEquals("foo/bar", getAppended().getParentPath().getRelative());
        assertTrue(getOne().getParentPath().getRelative().isEmpty());
    }