code: protected Map<String, Object> unsetUserRegistry(ServiceReference<UserRegistry> ref) {
          String id = parseIdFromConfigID((String) ref.getProperty(KEY_CONFIG_ID));
          userRegistries.removeReference(id, ref);
          notifyListeners();
  
          String type = (String) ref.getProperty(KEY_TYPE);
          if (type != null) {
              registryTypes.remove(type);
          } else {
              registryTypes.remove(UNKNOWN_TYPE);
          }
  
          /*
           * Don't refresh the user registry cache if we are shutting down.
           */
          if (FrameworkState.isStopping()) {
              return null;
          } else {
              return refreshUserRegistryCache();
          }
      }
docs: Method will be called for each UserRegistryConfiguration that is
  unregistered in the OSGi service registry. We must remove this
  instance from our internal map.
  <p>
  The ConcurrentServiceReferenceMap automatically guards against removing
  a reference of the wrong type, so this method does not need special
  logic to protect against the case where multiple configurations define
  the same ID but are of different types.
  
  @param ref Reference to an unregistered UserRegistryConfiguration