PsiElement (@Nullable PsiElement element, boolean up) { if (element == null) return null; if (up) { PsiElement parent; while ((parent = element.getParent()) instanceof GrParenthesizedExpression) { element = parent; } } else { while (element instanceof GrParenthesizedExpression) { element = ((GrParenthesizedExpression)element).getOperand(); } } return element; }