private static PsiElement getParent(PsiElement element) {
        PsiElement parent = element.getParent();
        while (parent instanceof PsiParenthesizedExpression ||
               parent instanceof PsiTypeCastExpression ||
               parent instanceof PsiConditionalExpression) {
          parent = parent.getParent();
        }
        return parent;
      }
private static PsiElement getParent(PsiElement element)