LiteralUtils { public static boolean isTrue(Tree tree) { return tree.is(Kind.BOOLEAN_LITERAL) && "true".equals(((LiteralTree) tree).value()); } private  LiteralUtils(); @CheckForNull static Integer intLiteralValue(ExpressionTree expression); @CheckForNull static Long longLiteralValue(ExpressionTree tree); static boolean isEmptyString(Tree tree); static boolean is0xff(ExpressionTree expression); static String trimQuotes(String value); static boolean isTextBlock(String value); static String trimLongSuffix(String longString); static boolean hasValue(Tree tree, String expectedValue); static boolean isTrue(Tree tree); static boolean isFalse(Tree tree); static boolean isZero(ExpressionTree tree); static boolean isOne(ExpressionTree tree); static boolean isNegOne(ExpressionTree tree);  }
@Test void isTrue_withExpectedValue_returnsTrue() { LiteralTree trueTree = (LiteralTree) getReturnExpression("void foo(){ return true; }"); assertThat(LiteralUtils.isTrue(trueTree)).isTrue(); }