@Test public void testWhileLoopUnchainedWithNestedExpressions() { String s = StatementBuilder.create() .declareVariable("str", String.class) .while_(Bool.expr( Bool.expr(Variable.get("str"), BooleanOperator.NotEquals, null), BooleanOperator.And, Bool.expr(Stmt.loadVariable("str").invoke("length"), BooleanOperator.GreaterThan, 0))) .finish().toJavaString(); assertEquals("Failed to generate while loop with nested expressions and no body", WHILE_NESTED_EMPTY, s); }