Condition<PsiFileSystemItem> () { return item -> { if (item instanceof PsiDirectory) return true; final VirtualFile virtualFile = item.getVirtualFile(); if (virtualFile == null) return false; return myAcceptedFileTypes.contains(virtualFile.getExtension()); }; }