private static @NotNull Set<? extends VirtualFile> asSet(@NotNull Collection<? extends VirtualFile> collection) {
    return collection instanceof Set ? (Set<? extends VirtualFile>)collection : new HashSet<>(collection);
  }
private static @NotNull Set<? extends VirtualFile> asSet(@NotNull Collection<? extends VirtualFile> collection)