Source:
<code>public void generateMethods(ClassDefinition classDefinition, CallSiteBinder callSiteBinder, RowExpression filter, List<RowExpression> projections) { CachedInstanceBinder cachedInstanceBinder = new CachedInstanceBinder(classDefinition, callSiteBinder); List<PreGeneratedExpressions> allPreGeneratedExpressions = new ArrayList<>(projections.size() + 1); generateProcessMethod(classDefinition, projections.size()); PreGeneratedExpressions filterPreGeneratedExpressions = generateMethodsForLambdaAndTry(classDefinition, callSiteBinder, cachedInstanceBinder, filter, "filter"); allPreGeneratedExpressions.add(filterPreGeneratedExpressions); generateFilterMethod(classDefinition, callSiteBinder, cachedInstanceBinder, filterPreGeneratedExpressions, filter); for (int i = 0; i < projections.size(); i++) { String methodName = "project_" + i; PreGeneratedExpressions projectPreGeneratedExpressions = generateMethodsForLambdaAndTry(classDefinition, callSiteBinder, cachedInstanceBinder, projections.get(i), methodName); allPreGeneratedExpressions.add(projectPreGeneratedExpressions); generateProjectMethod(classDefinition, callSiteBinder, cachedInstanceBinder, projectPreGeneratedExpressions, methodName, projections.get(i)); } MethodDefinition constructorDefinition = classDefinition.declareConstructor(a(PUBLIC)); BytecodeBlock constructorBody = constructorDefinition.getBody(); Variable thisVariable = constructorDefinition.getThis(); constructorBody.comment("super();") .append(thisVariable) .invokeConstructor(Object.class); cachedInstanceBinder.generateInitializations(thisVariable, constructorBody); for (PreGeneratedExpressions preGeneratedExpressions : allPreGeneratedExpressions) { preGeneratedExpressions.getLambdaFieldMap().values().forEach( <START> lambdaExpressionField -> lambdaExpressionField.generateInitialization(thisVariable, constructorBody) <END> ); } constructorBody.ret(); }</code><technical_language>a for-loop instead. I a strong opinion. I easier read way</technical_language>

Target:
public void generateMethods(ClassDefinition classDefinition, CallSiteBinder callSiteBinder, RowExpression filter, List<RowExpression> projections) { CachedInstanceBinder cachedInstanceBinder = new CachedInstanceBinder(classDefinition, callSiteBinder); List<PreGeneratedExpressions> allPreGeneratedExpressions = new ArrayList<>(projections.size() + 1); generateProcessMethod(classDefinition, projections.size()); PreGeneratedExpressions filterPreGeneratedExpressions = generateMethodsForLambdaAndTry(classDefinition, callSiteBinder, cachedInstanceBinder, filter, "filter"); allPreGeneratedExpressions.add(filterPreGeneratedExpressions); generateFilterMethod(classDefinition, callSiteBinder, cachedInstanceBinder, filterPreGeneratedExpressions, filter); for (int i = 0; i < projections.size(); i++) { String methodName = "project_" + i; PreGeneratedExpressions projectPreGeneratedExpressions = generateMethodsForLambdaAndTry(classDefinition, callSiteBinder, cachedInstanceBinder, projections.get(i), methodName); allPreGeneratedExpressions.add(projectPreGeneratedExpressions); generateProjectMethod(classDefinition, callSiteBinder, cachedInstanceBinder, projectPreGeneratedExpressions, methodName, projections.get(i)); } MethodDefinition constructorDefinition = classDefinition.declareConstructor(a(PUBLIC)); BytecodeBlock constructorBody = constructorDefinition.getBody(); Variable thisVariable = constructorDefinition.getThis(); constructorBody.comment("super();") .append(thisVariable) .invokeConstructor(Object.class); cachedInstanceBinder.generateInitializations(thisVariable, constructorBody); for (PreGeneratedExpressions preGeneratedExpressions : allPreGeneratedExpressions) { for (LambdaExpressionField field : preGeneratedExpressions.getLambdaFieldMap().values()) { field.generateInitialization(thisVariable, constructorBody); } } constructorBody.ret(); }