code: private void finalizeDiscriminator(DTNode<I> blockRoot, Splitter<I> splitter) {
          assert blockRoot.isBlockRoot();
  
          ContextPair<I> newDiscr = splitter.getNewDiscriminator();
  
          if (!blockRoot.getDiscriminator().equals(newDiscr)) {
              ContextPair<I> finalDiscriminator = prepareSplit(blockRoot, splitter);
              Map<Boolean, DTNode<I>> repChildren = new HashMap<>();
              for (Boolean label : blockRoot.getSplitData().getLabels()) {
                  repChildren.put(label, extractSubtree(blockRoot, label));
              }
              blockRoot.replaceChildren(repChildren);
  
              blockRoot.setDiscriminator(finalDiscriminator);
          } else {
              LOGGER.debug("Weird..");
          }
  
          declareFinal(blockRoot);
      }
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