@Test
public void createConsequenceWithMultipleFieldUpdate() {

    ArrayList<String> fields = new ArrayList<>();
    fields.add("\"age\"");
    fields.add("\"likes\"");
    MaterializedLambda.BitMaskVariable bitMaskVariable = new MaterializedLambda.BitMaskVariableWithFields("DomainClassesMetadata53448E6B9A07CB05B976425EF329E308.org_drools_modelcompiler_domain_Person_Metadata_INSTANCE", fields, "mask_$p");
    String consequenceBlock = "(org.drools.model.Drools drools, org.drools.modelcompiler.domain.Person $p) -> {{ ($p).setAge($p.getAge() + 1); ($p).setLikes(\"Cheese\"); drools.update($p,mask_$p); }}";
    CreatedClass aClass = new MaterializedLambdaConsequence("defaultpkg",
                                                            "defaultpkg.Rules53448E6B9A07CB05B976425EF329E308",
                                                            Arrays.asList(bitMaskVariable))
            .create(consequenceBlock, new ArrayList<>(), new ArrayList<>());
    //language=JAVA
    String expectedResult = "" +
            "package defaultpkg.P64;\n" +
            "\n" +
            "import static defaultpkg.Rules53448E6B9A07CB05B976425EF329E308.*;\n" +
            "import org.drools.modelcompiler.dsl.pattern.D;\n" +
            "\n" +
            "@org.drools.compiler.kie.builder.MaterializedLambda()\n" +
            "public enum LambdaConsequence642067D01B69A30A6F9EF6A4244CC6A7 implements org.drools.model.functions.Block2<org.drools.model.Drools, org.drools.modelcompiler.domain.Person> {\n" +
            "\n" +
            "    INSTANCE;\n" +
            "    public static final String EXPRESSION_HASH = \"15102979E2E45F1A4617C12D3517D6B5\";\n" +
            "    private final org.drools.model.BitMask mask_$p = org.drools.model.BitMask.getPatternMask(DomainClassesMetadata53448E6B9A07CB05B976425EF329E308.org_drools_modelcompiler_domain_Person_Metadata_INSTANCE, \"age\", \"likes\");\n" +
            "\n" +
            "    @Override()\n" +
            "    public void execute(org.drools.model.Drools drools, org.drools.modelcompiler.domain.Person $p) throws java.lang.Exception {\n" +
            "        {\n" +
            "            ($p).setAge($p.getAge() + 1);\n" +
            "            ($p).setLikes(\"Cheese\");\n" +
            "            drools.update($p, mask_$p);\n" +
            "        }\n" +
            "    }\n" +
            "}";
    assertThat(aClass.getCompilationUnitAsString(), equalToIgnoringWhiteSpace(expectedResult));
}