PsiElement (@NotNull FoldRegion region) { final SmartPsiElementPointer<?> pointer = myFoldRegionToSmartPointerMap.get(region); if (pointer == null) { return null; } PsiElement element = pointer.getElement(); return element != null && element.isValid() ? element : null; }