public static Path resolveRelative(Path p, String other) {
        Path op = Paths.get(other);
        if (op.isAbsolute()) {
            throw new IllegalArgumentException(other + " cannot be an absolute path!");
        }
        return p.resolve(op);
    }
@Test
    public void testSafeResolution() throws Exception {
        Path cwd = Paths.get(".");
        String windows = "C:/temp/file.txt";
        String linux = "/root/dir/file.txt";
        assertThrows(IllegalArgumentException.class, () -> {
            FSUtil.resolveRelative(cwd, linux);
            FSUtil.resolveRelative(cwd, windows);
        });
    }