protected final void setEndpoints(Iterable<Endpoint> endpoints) {
        if (!allowEmptyEndpoints && Iterables.isEmpty(endpoints)) {
            return;
        }
        final List<Endpoint> newEndpoints;
        endpointsLock.lock();
        try {
            final List<Endpoint> oldEndpoints = this.endpoints;
            newEndpoints = ImmutableList.sortedCopyOf(endpoints);
            if (!hasChanges(oldEndpoints, newEndpoints)) {
                return;
            }
            this.endpoints = newEndpoints;
            logger.info("New endpoints have been set: {}", toShortString(newEndpoints));
        } finally {
            endpointsLock.unlock();
        }

        maybeCompleteInitialEndpointsFuture(newEndpoints);
        notifyListeners(newEndpoints);
    }
Sets the specified {@link Endpoint}s as current {@link Endpoint} list.
core/src/main/java/com/linecorp/armeria/client/endpoint/DynamicEndpointGroup.java