public String getName() {
        if (elements.isEmpty()) return "";
        return elements.get(elements.size() - 1);
    }
@Test
    public void testGetName() {
        assertEquals("baz", getAbsolutePath().getName());
        assertEquals("baz", getRelativePath().getName());
        assertEquals("baz", getWithSlashes().getName());
        assertEquals("baz", getAppended().getName());
        assertEquals("foo", getOne().getName());
    }