docs: static Map<String, Object> sumOfDelta(Map<String, Object> state, Map<String, Object> delta) {
          InstanceKey instanceId = (InstanceKey) delta.get("InstanceKey");
          if (instanceId == null) {
              throw new RuntimeException("InstanceKey can not be null");
          }
          for (String key : delta.keySet()) {
              Object existing = state.get(key);
              Object current = delta.get(key);
              if (current instanceof Number) {
                  if (existing == null) {
                      existing = 0;
                  }
                  Number v = (Number) existing;
                  Number d = (Number) delta.get(key);
                  state.put(key, v.longValue() + d.longValue());
              } else if (current instanceof NumberList) {
                  if (existing == null) {
                      state.put(key, current);
                  } else {
                      state.put(key, ((NumberList) existing).sum((NumberList) current));
                  }
              } else {
                  Object o = delta.get(key);
                  if (o instanceof String[]) {
                      String[] vs = (String[]) o;
                      if (vs.length == 1) {
                          Object previousAggregateString = state.get(key);
                          if (previousAggregateString instanceof AggregateString) {
                              state.put(key, ((AggregateString) previousAggregateString).update(null, vs[0], instanceId));
                          } else {
                              state.put(key, AggregateString.create(vs[0], instanceId));
                          }
                      } else {
                          // it should always be AggregateString here since that's all we add above
                          AggregateString pas = (AggregateString) state.get(key);
                          state.put(key, pas.update(vs[0], vs[1], instanceId));
                      }
                  } else {
                      state.put(key, String.valueOf(o));
                  }
  
              }
          }
          return state;
      }