public static String normalize(final String path) {
        return normalize(path, true);
    }
@Test
    public void testPathNormalize() {
        {
            final Path path = new Path(PathNormalizer.normalize(
                    "/path/to/remove/.."), EnumSet.of(Path.Type.directory));
            assertEquals("/path/to", path.getAbsolute());
        }
        {
            final Path path = new Path(PathNormalizer.normalize(
                    "/path/to/remove/.././"), EnumSet.of(Path.Type.directory));
            assertEquals("/path/to", path.getAbsolute());
        }
        {
            final Path path = new Path(PathNormalizer.normalize(
                    "/path/remove/../to/remove/.././"), EnumSet.of(Path.Type.directory));
            assertEquals("/path/to", path.getAbsolute());
        }
        {
            final Path path = new Path(PathNormalizer.normalize(
                    "/path/to/remove/remove/../../"), EnumSet.of(Path.Type.directory));
            assertEquals("/path/to", path.getAbsolute());
        }
        {
            final Path path = new Path(PathNormalizer.normalize(
                    "/path/././././to"), EnumSet.of(Path.Type.directory));
            assertEquals("/path/to", path.getAbsolute());
        }
        {
            final Path path = new Path(PathNormalizer.normalize(
                    "./.path/to"), EnumSet.of(Path.Type.directory));
            assertEquals("/.path/to", path.getAbsolute());
        }
        {
            final Path path = new Path(PathNormalizer.normalize(
                    ".path/to"), EnumSet.of(Path.Type.directory));
            assertEquals("/.path/to", path.getAbsolute());
        }
        {
            final Path path = new Path(PathNormalizer.normalize(
                    "/path/.to"), EnumSet.of(Path.Type.directory));
            assertEquals("/path/.to", path.getAbsolute());
        }
        {
            final Path path = new Path(PathNormalizer.normalize(
                    "/path//to"), EnumSet.of(Path.Type.directory));
            assertEquals("/path/to", path.getAbsolute());
        }
        {
            final Path path = new Path(PathNormalizer.normalize(
                    "/path///to////"), EnumSet.of(Path.Type.directory));
            assertEquals("/path/to", path.getAbsolute());
        }
    }