void (@NotNull PomModelEvent event) { TreeAspect aspect = ContainerUtil.findInstance(event.getChangedAspects(), TreeAspect.class); if (aspect == null) return; TreeChangeEvent change = tryCast(event.getChangeSet(aspect), TreeChangeEvent.class); if (change == null) return; PsiFile psiFile = change.getRootElement().getPsi().getContainingFile(); VirtualFile changedFile = psiFile == null ? null : psiFile.getVirtualFile(); if (!Comparing.equal(changedFile, file)) return; changesHandler.run(); }