public static String relativize(String root, final String path) {
        if(StringUtils.isBlank(root)) {
            return path;
        }
        if(StringUtils.equals(root, path)) {
            return StringUtils.EMPTY;
        }
        if(!StringUtils.equals(root, String.valueOf(Path.DELIMITER))) {
            if(!StringUtils.endsWith(root, String.valueOf(Path.DELIMITER))) {
                root = root + Path.DELIMITER;
            }
        }
        if(StringUtils.contains(path, root)) {
            return StringUtils.substring(path, path.indexOf(root) + root.length());
        }
        return path;
    }
@Test
    public void testRelativize() {
        assertEquals("", PathRelativizer.relativize("/r", "/r"));
        assertEquals("/", PathRelativizer.relativize("/r", "/r//"));
        assertEquals("a", PathRelativizer.relativize("/", "/a"));
        assertEquals("/b/path", PathRelativizer.relativize("/a", "/b/path"));
        assertEquals("path", PathRelativizer.relativize("/a", "/a/path"));
        assertEquals("path", PathRelativizer.relativize("/a/", "/a/path"));
        assertEquals("path/", PathRelativizer.relativize("/a", "/a/path/"));
        assertEquals("a/path", PathRelativizer.relativize("public_html", "/home/user/public_html/a/path"));
        assertEquals("/home/user/public_html/a/path", PathRelativizer.relativize(null, "/home/user/public_html/a/path"));
    }