List<VcsDirectoryMapping> (@NotNull List<VcsDirectoryMapping> mappings) { List<VcsDirectoryMapping> newMapping = new ArrayList<>(); Set<String> paths = new HashSet<>(); for (VcsDirectoryMapping mapping : ContainerUtil.reverse(mappings)) { if (paths.add(mapping.getDirectory())) { newMapping.add(mapping); } } return newMapping; }