public Path back() {
        int size = back.size();
        if(size > 1) {
            forward.add(back.get(size - 1));
            Path p = back.get(size - 2);
            //delete the fetched path - otherwise we produce a loop
            back.remove(size - 1);
            back.remove(size - 2);
            return p;
        }
        else if(1 == size) {
            forward.add(back.get(0));
            return back.get(0);
        }
        return null;
    }
@Test
    public void testBack() {
        Navigation n = new Navigation();
        assertNull(n.back());
        n.add(new Path("a", EnumSet.of(Path.Type.directory)));
        n.add(new Path("b", EnumSet.of(Path.Type.directory)));
        assertEquals("a", n.back().getName());
        assertEquals("b", n.forward().getName());
    }