private static ProtobufMessages.NodeMemory writeAccumulateNodeMemory(
final int nodeId, final Memory memory) {
// for accumulate nodes, we need to store the ID of created (result)
// handles
AccumulateMemory accmem = (AccumulateMemory) memory;
if (accmem.betaMemory.getLeftTupleMemory().size() > 0) {
ProtobufMessages.NodeMemory.AccumulateNodeMemory.Builder _accumulate = ProtobufMessages.NodeMemory.AccumulateNodeMemory
.newBuilder();
final org.drools.core.util.Iterator tupleIter = accmem.betaMemory