MavenWorkspaceMap (MavenWorkspaceMap workspaceMap, Function<? super String, String> transformer) { MavenWorkspaceMap result = new MavenWorkspaceMap(); for (Map.Entry<MavenId, Data> entry : workspaceMap.myMapping.entrySet()) { Data data = entry.getValue(); File outputFile = data.outputFile == null ? null : new File(transformer.apply(data.outputFile.getAbsolutePath())); File file = new File(transformer.apply(data.file.getAbsolutePath())); result.myMapping.put(entry.getKey(), new Data(data.originalId, file, outputFile)); } return result; }