code: private void finalizeDiscriminator(AbstractBaseDTNode<I, D> blockRoot, Splitter<I, D> splitter) {
          assert blockRoot.isBlockRoot();
  
          notifyPreFinalizeDiscriminator(blockRoot, splitter);
  
          Word<I> succDiscr = splitter.getDiscriminator().prepend(alphabet.getSymbol(splitter.symbolIdx));
  
          if (!blockRoot.getDiscriminator().equals(succDiscr)) {
              Word<I> finalDiscriminator = prepareSplit(blockRoot, splitter);
              Map<D, AbstractBaseDTNode<I, D>> repChildren = createMap();
              for (D label : blockRoot.getSplitData().getLabels()) {
                  repChildren.put(label, extractSubtree(blockRoot, label));
              }
              blockRoot.replaceChildren(repChildren);
  
              blockRoot.setDiscriminator(finalDiscriminator);
          }
  
          declareFinal(blockRoot);
  
          notifyPostFinalizeDiscriminator(blockRoot, splitter);
      }
docs: Finalize a discriminator. Given a block root and a {@link Splitter}, replace the discriminator at the block root
  by the one derived from the splitter, and update the discrimination tree accordingly.
  
  @param blockRoot
  the block root whose discriminator to finalize
  @param splitter
  the splitter to use for finalization