@Override
    public Map<Path, Path> normalize(final Map<Path, Path> files) {
        final Map<Path, Path> normalized = new HashMap<>();
        Iterator<Path> sourcesIter = files.keySet().iterator();
        Iterator<Path> destinationsIter = files.values().iterator();
        while(sourcesIter.hasNext()) {
            Path source = sourcesIter.next();
            Path destination = destinationsIter.next();
            boolean duplicate = false;
            for(Iterator<Path> normalizedIter = normalized.keySet().iterator(); normalizedIter.hasNext(); ) {
                Path n = normalizedIter.next();
                if(source.isChild(n)) {
                    if(log.isDebugEnabled()) {
                        log.debug(String.format("Remove path %s already included by directory", source.getAbsolute()));
                    }
                    // The selected file is a child of a directory already included
                    duplicate = true;
                    break;
                }
                if(n.isChild(source)) {
                    if(log.isDebugEnabled()) {
                        log.debug(String.format("Remove path %s already included by directory", n.getAbsolute()));
                    }
                    // Remove the previously added file as it is a child
                    // of the currently evaluated file
                    normalizedIter.remove();
                }
            }
            if(!duplicate) {
                normalized.put(source, destination);
            }
        }
        return normalized;
    }
@Test
    public void testNormalizeNone() {
        CopyRootPathsNormalizer normalizer = new CopyRootPathsNormalizer();
        final HashMap<Path, Path> files = new HashMap<>();
        files.put(new Path("/p", EnumSet.of(Path.Type.directory)), new Path("/d", EnumSet.of(Path.Type.directory)));
        assertEquals(files, normalizer.normalize(files));
    }