PsiExpression (@Nullable PsiExpression element) { while (element instanceof PsiParenthesizedExpression || element instanceof PsiTypeCastExpression) { if (element instanceof PsiParenthesizedExpression) { element = ((PsiParenthesizedExpression)element).getExpression(); } if (element instanceof PsiTypeCastExpression) { element = ((PsiTypeCastExpression)element).getOperand(); } } return element; }