code: public boolean addReference(ServiceReference<T> reference) {
          if (reference == null)
              return false;
  
          ConcurrentServiceReferenceElement<T> element = new ConcurrentServiceReferenceElement<T>(referenceName, reference);
  
          synchronized (elementMap) {
              ConcurrentServiceReferenceElement<T> oldElement = elementMap.put(reference, element);
              if (oldElement != null) {
                  if (!element.getRanking().equals(oldElement.getRanking())) {
                      elementSetUnsorted = true;
                  }
                  return true;
              }
  
              elementSet.add(element);
          }
          return false;
      }
docs: Adds the service reference to the set, or notifies the set that the
  service ranking for the reference might have been updated.
  
  @param reference ServiceReference for the target service
  @return true if this set already contained the service reference