public void check(@NotNull final File file) {
    boolean parentAlreadyRegistered =
      ContainerUtil.or(myParentPaths, parentCandidate -> VfsUtilCore.isAncestor(parentCandidate, file, true));

    if (!parentAlreadyRegistered) {
      ContainerUtil.retainAll(myParentPaths, childCandidate -> !VfsUtilCore.isAncestor(file, childCandidate, true));

      myParentPaths.add(file);
    }
  }
public void check(@NotNull final File file)