docs: public void registerChannels(String importer, Set<URI> uris) {
          NavigableSet<String> registered = m_callbacks.getReference().navigableKeySet();
          Preconditions.checkArgument(
                  importer != null && !importer.trim().isEmpty(),
                  "importer is null or empty"
                  );
          Preconditions.checkArgument(uris != null, "uris set is null");
          Preconditions.checkArgument(
                  !FluentIterable.from(uris).anyMatch(isNull()),
                  "uris set %s contains null elements", uris
                  );
          if (!registered.contains(importer)) {
              if (uris.isEmpty()) {
                  // ImporterLifeCycleManager.stop() calls registerChannels() is called with an empty set of URIs.
                  // If the importer never finished starting, we hit this condition.
                  // This log message is used by the TestImporterStopAfterIncompleteStart JUnit.
                  LOG.info("Skipping channel un-registration for " + importer + " since it did not finish initialization");
                  return;
              } else {
                  throw new IllegalStateException("no callbacks registered for " + importer
                          + " - unable to register channels " + Arrays.toString(uris.toArray()));
              }
          }
  
          Predicate<ChannelSpec> forImporter = ChannelSpec.importerIs(importer);
          Function<URI,ChannelSpec> asSpec = ChannelSpec.fromUri(importer);
  
          // convert method parameters to a set of ChannelSpecs
          NavigableSet<ChannelSpec> proposed = ImmutableSortedSet.copyOf(
                  FluentIterable.from(uris).transform(asSpec)
                  );
  
          LOG.info("(" + m_hostId + ") proposing channels " + proposed);
  
          int [] stamp = new int[]{0};
  
          ImmutableSortedSet.Builder<ChannelSpec> sbldr = null;
          NavigableSet<ChannelSpec> prev = null;
          SetData setter = null;
          NavigableSet<ChannelSpec> masterList = null;
          // retry writes when merging with stale data
          do {
              prev = m_channels.get(stamp);
  
              NavigableSet<ChannelSpec> current  = Sets.filter(prev, forImporter);
              if (current.equals(proposed)) {
                  return;
              }
              sbldr = ImmutableSortedSet.naturalOrder();
              sbldr.addAll(Sets.filter(prev, not(forImporter)));
              sbldr.addAll(proposed);
  
              byte [] data = null;
              try {
                  masterList = sbldr.build();
                  data = asHostData(masterList);
              } catch (JSONException|IllegalArgumentException e) {
                  throw loggedDistributerException(e, "failed to serialize the registration as json");
              }
  
              setter = new SetData(MASTER_DN, stamp[0], data);
          } while (setter.getCallbackCode() == Code.BADVERSION);
  
          //synch master channel list after channel registrations.
          int [] sstamp = new int[]{0};
          prev = m_channels.get(sstamp);
          m_channels.compareAndSet(prev, masterList, sstamp[0], stamp[0]);
  
          setter.getStat();
      }