public static String parent(final String absolute, final char delimiter) {
        if(String.valueOf(delimiter).equals(absolute)) {
            return null;
        }
        int index = absolute.length() - 1;
        if(absolute.charAt(index) == delimiter) {
            if(index > 0) {
                index--;
            }
        }
        int cut = absolute.lastIndexOf(delimiter, index);
        if(cut > 0) {
            return absolute.substring(0, cut);
        }
        //if (index == 0) parent is root
        return String.valueOf(delimiter);
    }
@Test
    public void testParent() {
        assertEquals("/", PathNormalizer.parent("/p", '/'));
        assertEquals("/p", PathNormalizer.parent("/p/n", '/'));
        assertNull(PathNormalizer.parent("/", '/'));
    }