// Path: parboiled-java/src/test/java/org/parboiled/transform/AsmTestUtils.java
// public static void assertTraceDumpEquality(MethodNode method, String traceDump) throws Exception {
//     checkArgNotNull(method, "method");
//     Printer printer = new NonMaxTextifier();
//     TraceMethodVisitor traceMethodVisitor = new TraceMethodVisitor(printer);
//     // MethodAdapter checkMethodAdapter = new MethodAdapter(traceMethodVisitor);
//     MethodVisitor checkMethodAdapter = new CheckMethodAdapter(traceMethodVisitor);
//     method.accept(checkMethodAdapter);
//     StringWriter stringWriter = new StringWriter();
//     PrintWriter printWriter = new PrintWriter(stringWriter);
//     printer.print(printWriter);
//     printWriter.flush();
// 
//     assertEquals(stringWriter.toString(), traceDump);
// }


import org.parboiled.common.ImmutableList;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import java.io.IOException;
import java.util.List;
import static org.parboiled.transform.AsmTestUtils.assertTraceDumpEquality;
                "    INVOKESTATIC java/lang/Boolean.valueOf (Z)Ljava/lang/Boolean;\n" +
                "    ICONST_0\n" +
                "    ANEWARRAY java/lang/Object\n" +
                "    INVOKEVIRTUAL org/parboiled/transform/TestParser.Sequence (Ljava/lang/Object;Ljava/lang/Object;[Ljava/lang/Object;)Lorg/parboiled/Rule;\n" +
                "    GOTO L2\n" +
                "   L1\n" +
                "    ACONST_NULL\n" +
                "   L2\n" +
                "    ARETURN\n");

        assertTraceDumpEquality(processMethod("RuleWith2Returns", processors), "" +
                "    ILOAD 1\n" +
                "    ALOAD 0\n" +
                "    GETFIELD org/parboiled/transform/TestParser.integer : I\n" +
                "    IF_ICMPNE L0\n" +
                "    ALOAD 0\n" +
                "    BIPUSH 97\n" +
                "    INVOKESTATIC java/lang/Character.valueOf (C)Ljava/lang/Character;\n" +
                "    ALOAD 0\n" +
                "    INVOKEVIRTUAL org/parboiled/transform/TestParser.action ()Z\n" +
                "    INVOKESTATIC org/parboiled/transform/TestParser.ACTION (Z)Lorg/parboiled/Action;\n" +
                "    ICONST_0\n" +
                "    ANEWARRAY java/lang/Object\n" +
                "    INVOKEVIRTUAL org/parboiled/transform/TestParser.Sequence (Ljava/lang/Object;Ljava/lang/Object;[Ljava/lang/Object;)Lorg/parboiled/Rule;\n" +
                "    GOTO L1\n" +
                "   L0\n" +
                "    GETSTATIC org/parboiled/transform/TestParser.EOI : Lorg/parboiled/Rule;\n" +
                "   L1\n" +
                "    ARETURN\n");

// Path: parboiled-java/src/test/java/org/parboiled/transform/AsmTestUtils.java
// public static void assertTraceDumpEquality(MethodNode method, String traceDump) throws Exception {
//     checkArgNotNull(method, "method");
//     Printer printer = new NonMaxTextifier();
//     TraceMethodVisitor traceMethodVisitor = new TraceMethodVisitor(printer);
//     // MethodAdapter checkMethodAdapter = new MethodAdapter(traceMethodVisitor);
//     MethodVisitor checkMethodAdapter = new CheckMethodAdapter(traceMethodVisitor);
//     method.accept(checkMethodAdapter);
//     StringWriter stringWriter = new StringWriter();
//     PrintWriter printWriter = new PrintWriter(stringWriter);
//     printer.print(printWriter);
//     printWriter.flush();
// 
//     assertEquals(stringWriter.toString(), traceDump);
// }


// Path: parboiled-java/src/test/java/org/parboiled/transform/ReturnInstructionUnifierTest.java
import org.parboiled.common.ImmutableList;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import java.io.IOException;
import java.util.List;
import static org.parboiled.transform.AsmTestUtils.assertTraceDumpEquality;

                "    INVOKESTATIC java/lang/Boolean.valueOf (Z)Ljava/lang/Boolean;\n" +
                "    ICONST_0\n" +
                "    ANEWARRAY java/lang/Object\n" +
                "    INVOKEVIRTUAL org/parboiled/transform/TestParser.Sequence (Ljava/lang/Object;Ljava/lang/Object;[Ljava/lang/Object;)Lorg/parboiled/Rule;\n" +
                "    GOTO L2\n" +
                "   L1\n" +
                "    ACONST_NULL\n" +
                "   L2\n" +
                "    ARETURN\n");

        assertTraceDumpEquality(processMethod("RuleWith2Returns", processors), "" +
                "    ILOAD 1\n" +
                "    ALOAD 0\n" +
                "    GETFIELD org/parboiled/transform/TestParser.integer : I\n" +
                "    IF_ICMPNE L0\n" +
                "    ALOAD 0\n" +
                "    BIPUSH 97\n" +
                "    INVOKESTATIC java/lang/Character.valueOf (C)Ljava/lang/Character;\n" +
                "    ALOAD 0\n" +
                "    INVOKEVIRTUAL org/parboiled/transform/TestParser.action ()Z\n" +
                "    INVOKESTATIC org/parboiled/transform/TestParser.ACTION (Z)Lorg/parboiled/Action;\n" +
                "    ICONST_0\n" +
                "    ANEWARRAY java/lang/Object\n" +
                "    INVOKEVIRTUAL org/parboiled/transform/TestParser.Sequence (Ljava/lang/Object;Ljava/lang/Object;[Ljava/lang/Object;)Lorg/parboiled/Rule;\n" +
                "    GOTO L1\n" +
                "   L0\n" +
                "    GETSTATIC org/parboiled/transform/TestParser.EOI : Lorg/parboiled/Rule;\n" +
                "   L1\n" +
                "    ARETURN\n");

        assertTraceDumpEquality(processMethod("RuleWithDirectExplicitAction", processors), "" +