Expressions { public static Expression removeParentheses(@Nullable Expression expression) { if (expression == null) { return null; } Expression res = expression; while (res.is(Kind.PARENTHESIZED)) { res = ((ParenthesizedExpression) res).expression(); } return res; } private  Expressions(); static boolean isFalsy(@Nullable Expression expression); static Expression singleAssignedValue(Name name); static Expression removeParentheses(@Nullable Expression expression); static String unescape(StringLiteral stringLiteral); static String unescape(StringElement stringElement);  }
@Test public void remove_parentheses() { assertThat(removeParentheses(exp("42")).getKind()).isEqualTo(Kind.NUMERIC_LITERAL); assertThat(removeParentheses(exp("(42)")).getKind()).isEqualTo(Kind.NUMERIC_LITERAL); assertThat(removeParentheses(exp("((42))")).getKind()).isEqualTo(Kind.NUMERIC_LITERAL); assertThat(removeParentheses(exp("((a))")).getKind()).isEqualTo(Kind.NAME); assertThat(removeParentheses(null)).isNull(); }