@Test
public void testDoWhileLoopUnchainedWithNestedExpressions() {
String s = StatementBuilder.create()
.declareVariable("str", String.class)
.do_()
.append(StatementBuilder.create().loadStatic(System.class, "out").invoke("println", Variable.get("str")))
.finish()
.while_(Bool.expr(
Bool.expr(Variable.get("str"), BooleanOperator.NotEquals, null),
BooleanOperator.And,
Bool.expr(Stmt.loadVariable("str").invoke("length"), BooleanOperator.GreaterThan, 0)))
.toJavaString();
assertEquals("Failed to generate do while loop with nested expression", DOWHILE_NESTED_EXPRESSION, s);
}