public void RefreshUsedIn()
        {
            var s      = Sim;
            var usedIn = _deviceActionGroup.CalculateUsedIns(s);

            _usedIns.Clear();
            foreach (var dui in usedIn)
            {
                _usedIns.Add(dui);
            }
        }
        private void CheckGroupUsage([NotNull] Simulator sim, [NotNull] DeviceActionGroup actionGroup)
        {
            if (!PerformCleanupChecks)
            {
                return;
            }

            var result = actionGroup.CalculateUsedIns(sim);

            if (result.Count == 0)
            {
                throw new DataIntegrityException(
                          "The device action group " + actionGroup + " is not used. Please fix or delete!", actionGroup);
            }
        }