LiteralUtils { public static boolean isFalse(Tree tree) { return tree.is(Kind.BOOLEAN_LITERAL) && "false".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 private_constructor() throws Exception { Constructor<LiteralUtils> constructor = LiteralUtils.class.getDeclaredConstructor(); assertThat(constructor.isAccessible()).isFalse(); constructor.setAccessible(true); constructor.newInstance(); }
@Test void isFalse_withNonBooleanLiteral_returnsFalse() { ExpressionTree tree = getFirstExpression("void foo(java.util.Properties props){ props.setProperty(\"myKey\", \"myValue\"); }"); assertThat(LiteralUtils.isFalse(tree)).isFalse(); }
@Test void isFalse_withTrueValue_returnsFalse() { LiteralTree trueTree = (LiteralTree) getReturnExpression("void foo(){ return true; }"); assertThat(LiteralUtils.isFalse(trueTree)).isFalse(); }