code: private void adaptForInsert(final ITreeData paramNewNode, final boolean addAsFirstChild) throws TTException {
          assert paramNewNode != null;
  
          if (paramNewNode instanceof ITreeStructData) {
              final ITreeStructData strucNode = (ITreeStructData)paramNewNode;
              final ITreeStructData parent = (ITreeStructData)getPtx().getData(paramNewNode.getParentKey());
              parent.incrementChildCount();
              if (addAsFirstChild) {
                  parent.setFirstChildKey(paramNewNode.getDataKey());
              }
              getPtx().setData(parent);
  
              if (strucNode.hasRightSibling()) {
                  final ITreeStructData rightSiblingNode =
                      (ITreeStructData)getPtx().getData(strucNode.getRightSiblingKey());
                  rightSiblingNode.setLeftSiblingKey(paramNewNode.getDataKey());
                  getPtx().setData(rightSiblingNode);
              }
              if (strucNode.hasLeftSibling()) {
                  final ITreeStructData leftSiblingNode =
                      (ITreeStructData)getPtx().getData(strucNode.getLeftSiblingKey());
                  leftSiblingNode.setRightSiblingKey(paramNewNode.getDataKey());
                  getPtx().setData(leftSiblingNode);
              }
          }
  
      }
docs: Adapting everything for insert operations.
  
  @param paramNewNode
  pointer of the new node to be inserted
  @param addAsFirstChild
  determines the position where to insert
  @throws TTIOException
  if anything weird happens