docs: private TreeNode insert(TreeNode node, NumberVector nv) {
      // Find closest child:
      ClusteringFeature[] cfs = node.children;
      assert (cfs[0] != null) : "Unexpected empty node!";
  
      // Find the best child:
      ClusteringFeature best = cfs[0];
      double bestd = distance.squaredDistance(nv, best);
      for(int i = 1; i < cfs.length; i++) {
        ClusteringFeature cf = cfs[i];
        if(cf == null) {
          break;
        }
        double d2 = distance.squaredDistance(nv, cf);
        if(d2 < bestd) {
          best = cf;
          bestd = d2;
        }
      }
  
      // Leaf node:
      if(!(best instanceof TreeNode)) {
        // Threshold constraint satisfied?
        if(absorption.squaredCriterion(best, nv) <= thresholdsq) {
          best.addToStatistics(nv);
          node.addToStatistics(nv);
          return null;
        }
        best = new ClusteringFeature(nv.getDimensionality());
        best.addToStatistics(nv);
        ++leaves;
        if(add(node.children, best)) {
          node.addToStatistics(nv); // Update statistics
          return null;
        }
        return split(node, best);
      }
      assert (best instanceof TreeNode) : "Node is neither child nor inner?";
      TreeNode newchild = insert((TreeNode) best, nv);
      if(newchild == null || add(node.children, newchild)) {
        node.addToStatistics(nv); // Update statistics
        return null;
      }
      return split(node, newchild);
    }