code: public boolean unregisterService(MockServiceRegistration<?> unregisteredServiceRegistration) {
          boolean unregistrationSuccess = true;
          ServiceReference<?> serviceReference = unregisteredServiceRegistration.getReference();
          String serviceClassName = findServiceClassName(serviceReference);
          if (serviceRegistrations.containsKey(serviceClassName)) {
              serviceRegistrations.get(serviceClassName).remove(serviceReference);
              if (serviceRegistrations.get(serviceClassName).isEmpty()) {
                  // Last implementation gone, remove from registry
                  serviceRegistrations.remove(serviceClassName);
              }
  
              notifyListenersAboutRemovedService(serviceClassName, serviceReference);
          } else {
              unregistrationSuccess = false;
          }
  
          if (serviceImplementations.containsKey(serviceReference)) {
              serviceImplementations.remove(serviceReference);
          } else {
              unregistrationSuccess = false;
          }
  
          return unregistrationSuccess;
      }
docs: Retract a service registration (a provided service).
  
  @param unregisteredServiceRegistration a {@link ServiceRegistration} for the service that should be unregistered
  @return true if unregistration is successful and false if unregistration fails (e.g. if the service can't be found).