@Override
  public void setMappings(@NotNull Map<VirtualFile, T> mappings) {
    Collection<VirtualFile> oldFiles;
    synchronized (myMappings) {
      myDeferredMappings = null;
      oldFiles = new ArrayList<>(myMappings.keySet());
      Set<VirtualFile> oldAndNewKeys = new HashSet<>();
      oldAndNewKeys.addAll(myMappings.keySet());
      oldAndNewKeys.addAll(mappings.keySet());
      for (VirtualFile key : oldAndNewKeys) {
        T oldValue = doGetImmediateMapping(key);
        T newValue = mappings.get(key);
        if (!Objects.equals(oldValue, newValue)) {
          if (newValue == null) {
            myMappings.remove(key);
          }
          else {
            myMappings.put(key, MappingValue.known(newValue));
          }
        }
      }

      cleanup();
    }
    Project project = getProject();
    handleMappingChange(mappings.keySet(), oldFiles, project != null && !project.isDefault());
  }
@Override
  public void setMappings(@NotNull Map<VirtualFile, T> mappings)