code: public Result<T> addAttributes(ServiceInfo.Key key, Attributes attributes)
      {
          T previous = null;
          T current = null;
  
          lock();
          try
          {
              previous = get(key);
              // Updating a service that does not exist must fail (RFC 2608, 9.3)
              if (previous == null)
                  throw new ServiceLocationException("Could not find service to update " + key, SLPError.INVALID_UPDATE);
  
              current = (T)previous.addAttributes(attributes);
              keysToServiceInfos.put(current.getKey(), current);
              current.setRegistered(true);
              previous.setRegistered(false);
          }
          finally
          {
              unlock();
          }
  
          notifyServiceUpdated(previous, current);
          return new Result<T>(previous, current);
      }
docs: Updates an existing ServiceInfo identified by the given Key, adding the given attributes.
  
  @param key        the service's key
  @param attributes the attributes to add
  @return a result whose previous is the service prior the update and where current is the current service