code: public Result<T> remove(ServiceInfo.Key key)
      {
          T previous = null;
  
          lock();
          try
          {
              ServiceType serviceType = keysToServiceTypes.remove(key);
              if (serviceType == null) return new Result<T>(null, null);
              previous = keysToServiceInfos.remove(key);
              previous.setRegistered(false);
          }
          finally
          {
              unlock();
          }
  
          notifyServiceRemoved(previous, null);
          return new Result<T>(previous, null);
      }
docs: Removes an existing entry with the given {@link ServiceInfo.Key}; if the entry does not exist, does nothing.
  
  @param key the service's key
  @return a result whose previous is the existing service and where current is null