docs: private ImmutableList<CharacterRegion> canonicalize(ImmutableList<CharacterRegion> inputRegions) {
      boolean mergedAnything = false;
      final ImmutableList.Builder<CharacterRegion> canonicalizedRegions = ImmutableList.builder();
      CharacterRegion bufferRegion = null;
  
      for (final CharacterRegion curRegion : inputRegions) {
        if (bufferRegion == null) {
          bufferRegion = curRegion;
        } else {
          if (bufferRegion.mayMergeWithFollowing(curRegion)) {
            mergedAnything = true;
            bufferRegion = bufferRegion.mergeFollowingRegion(curRegion);
          } else {
            canonicalizedRegions.add(bufferRegion);
            bufferRegion = curRegion;
          }
        }
      }
  
      if (bufferRegion != null) {
        canonicalizedRegions.add(bufferRegion);
      }
  
      if (mergedAnything) {
        return canonicalizedRegions.build();
      } else {
        return inputRegions;
      }
    }