code: private void rollingAdd() throws TTException {
          // start with hash to add
          final ITreeData startNode = mDelegate.getCurrentNode();
          long hashToAdd = startNode.hashCode();
          long newHash = 0;
          long possibleOldHash = 0;
          // go the path to the root
          do {
              synchronized (mDelegate.getCurrentNode()) {
                  getPtx().getData(mDelegate.getCurrentNode().getDataKey());
                  if (mDelegate.getCurrentNode().getDataKey() == startNode.getDataKey()) {
                      // at the beginning, take the hashcode of the node only
                      newHash = hashToAdd;
                  } else if (mDelegate.getCurrentNode().getDataKey() == startNode.getParentKey()) {
                      // at the parent level, just add the node
                      possibleOldHash = mDelegate.getCurrentNode().getHash();
                      newHash = possibleOldHash + hashToAdd * PRIME;
                      hashToAdd = newHash;
                  } else {
                      // at the rest, remove the existing old key for this element
                      // and add the new one
                      newHash = mDelegate.getCurrentNode().getHash() - (possibleOldHash * PRIME);
                      newHash = newHash + hashToAdd * PRIME;
                      hashToAdd = newHash;
                      possibleOldHash = mDelegate.getCurrentNode().getHash();
                  }
                  mDelegate.getCurrentNode().setHash(newHash);
                  getPtx().setData(mDelegate.getCurrentNode());
              }
          } while (moveTo(mDelegate.getCurrentNode().getParentKey()));
          mDelegate.setCurrentNode(startNode);
      }
docs: Adapting the structure with a rolling hash for all ancestors only with
  insert.
  
  @throws TTIOException
  if anything weird happened