@Override
 public void close() {
   if (recordChanges.size() <= 32) {
     recordChanges.clear();
   } else {
     // Let's not allow the internal maps to grow too big over time.
     recordChanges = new HashMap<>();
   }
   changeCounter.clear();
 }
    private RECORD prepareForChange() {
      ensureHasBeforeRecordImage();
      if (!this.changed) {
        RecordProxy<KEY, RECORD, ADDITIONAL> previous = this.allChanges.put(key, this);

        if (previous == null || !previous.isChanged()) {
          changeCounter.increment();
        }

        this.changed = true;
      }
      return this.record;
    }
 @Override
 public int changeSize() {
   return changeCounter.value();
 }