code: protected function fixDefault(TaxGroupInterface $taxGroup)
      {
          if (!$this->persistenceHelper->isChanged($taxGroup, ['default'])) {
              return;
          }
  
          if ($taxGroup->isDefault()) {
              try {
                  $previousTaxGroup = $this->taxGroupRepository->findDefault();
              } catch (RuntimeException $e) {
                  return;
              }
  
              if (null === $previousTaxGroup || $previousTaxGroup === $taxGroup) {
                  return;
              }
  
              $previousTaxGroup->setDefault(false);
  
              $this->persistenceHelper->persistAndRecompute($previousTaxGroup, false);
          }
      }
docs: Fixes the default tax group.
  
  @param TaxGroupInterface $taxGroup