void () { List<VcsDirectoryMapping> newMappings = getModelMappings(); List<VcsDirectoryMapping> previousMappings = myVcsManager.getDirectoryMappings(); myVcsConfiguration.addIgnoredUnregisteredRoots(previousMappings.stream() .filter(mapping -> !newMappings.contains(mapping) && !mapping.isDefaultMapping()) .map(mapping -> mapping.getDirectory()) .collect(Collectors.toList())); myVcsConfiguration.removeFromIgnoredUnregisteredRoots(map(newMappings, VcsDirectoryMapping::getDirectory)); }