boolean (PsiFile element) { PsiDirectory psiDirectory = element.getParent(); PsiElement[] children = psiDirectory.getChildren(); for (PsiElement child : children) { if (child != element && element.getVirtualFile().getNameWithoutExtension().equals(((PsiFile)child).getVirtualFile().getNameWithoutExtension())) { return true; } } return false; }