private static void createAddToResultGuarded(JBlock block, JClass jClass, String[] jsonItemTypes,
                                               boolean lenientDeserialize) {
    JCodeModel model = jClass.owner();
    JConditional ifBlock = block._if(createTokenCondition(model, jsonItemTypes));
    createAddToResult(ifBlock._then(), jClass);
    JBlock errorBlock = ifBlock._else();
    if (lenientDeserialize) {
      errorBlock.invoke(JExpr.ref("parser"), "readValueAsTree");
    }
    else {
      errorBlock.invoke(JExpr.ref("deserializationContext"), "handleUnexpectedToken")
        .arg(jClass.dotclass())
        .arg(JExpr.ref("parser"));
    }
  }
private static void createAddToResultGuarded(JBlock block, JClass jClass, String[] jsonItemTypes,
                                               boolean lenientDeserialize)