code: protected final void setEndpoints(Iterable<Endpoint> endpoints) {
          final List<Endpoint> oldEndpoints = this.endpoints;
          final List<Endpoint> newEndpoints = ImmutableList.sortedCopyOf(endpoints);
  
          if (oldEndpoints.equals(newEndpoints)) {
              return;
          }
  
          endpointsLock.lock();
          try {
              this.endpoints = newEndpoints;
          } finally {
              endpointsLock.unlock();
          }
  
          notifyListeners(newEndpoints);
          completeInitialEndpointsFuture(newEndpoints);
      }
docs: Sets the specified {@link Endpoint}s as current {@link Endpoint} list.