for (int i = 0; i < resultRows.size(); i++) {
Row row = resultRows.get(i);
Object[] values = row.getValues();
for (Entry<SelectItem, Object> entry : functionResult.entrySet()) {
SelectItem item = entry.getKey();
int itemIndex = row.indexOf(item);
if (itemIndex != -1) {
Object value = entry.getValue();
values[itemIndex] = value;
}
}