@Test public void test_skip_parentheses() { Tree parenthesizedExpression1 = new ParenthesizedExpressionTreeImpl(null, TRUE_LITERAL, null, null); Tree parenthesizedExpression2 = new ParenthesizedExpressionTreeImpl(null, parenthesizedExpression1, null, null); assertThat(skipParentheses(parenthesizedExpression1)).isEqualTo(TRUE_LITERAL); assertThat(skipParentheses(parenthesizedExpression2)).isEqualTo(TRUE_LITERAL); assertThat(skipParentheses(TRUE_LITERAL)).isEqualTo(TRUE_LITERAL); }
public static Tree skipParentheses(Tree tree) { Tree result = tree; while (result instanceof ParenthesizedExpressionTree) { result = ((ParenthesizedExpressionTree) result).expression(); } return result; }
ExpressionUtils { public static Tree skipParentheses(Tree tree) { Tree result = tree; while (result instanceof ParenthesizedExpressionTree) { result = ((ParenthesizedExpressionTree) result).expression(); } return result; } }
ExpressionUtils { public static Tree skipParentheses(Tree tree) { Tree result = tree; while (result instanceof ParenthesizedExpressionTree) { result = ((ParenthesizedExpressionTree) result).expression(); } return result; } private  ExpressionUtils(); }
ExpressionUtils { public static Tree skipParentheses(Tree tree) { Tree result = tree; while (result instanceof ParenthesizedExpressionTree) { result = ((ParenthesizedExpressionTree) result).expression(); } return result; } private  ExpressionUtils(); static boolean isBooleanLiteral(Tree tree); static boolean isFalseValueLiteral(Tree originalTree); static boolean isTrueValueLiteral(Tree originalTree); static boolean isNegation(Tree tree); static boolean isBinaryOperation(Tree tree, BinaryExpressionTree.Operator operator); static boolean isLogicalBinaryExpression(Tree tree); static Tree skipParentheses(Tree tree); static boolean containsPlaceHolder(Tree tree); static boolean isTernaryOperator(Deque<Tree> ancestors, Tree tree); static Optional<String> getMemberSelectOrIdentifierName(Tree tree); }
ExpressionUtils { public static Tree skipParentheses(Tree tree) { Tree result = tree; while (result instanceof ParenthesizedExpressionTree) { result = ((ParenthesizedExpressionTree) result).expression(); } return result; } private  ExpressionUtils(); static boolean isBooleanLiteral(Tree tree); static boolean isFalseValueLiteral(Tree originalTree); static boolean isTrueValueLiteral(Tree originalTree); static boolean isNegation(Tree tree); static boolean isBinaryOperation(Tree tree, BinaryExpressionTree.Operator operator); static boolean isLogicalBinaryExpression(Tree tree); static Tree skipParentheses(Tree tree); static boolean containsPlaceHolder(Tree tree); static boolean isTernaryOperator(Deque<Tree> ancestors, Tree tree); static Optional<String> getMemberSelectOrIdentifierName(Tree tree);  }