private void updateState(State state) {
        if (!allowEmptyEndpoints && Iterables.isEmpty(state.endpoints())) {
            return;
        }
        stateLock.lock();
        try {
            // It is too much work to keep track of the snapshot/endpoints/attributes that determine
            // whether the state is cacheable or not. For now, to prevent bugs we just set the
            // state transparently and don't decide whether to notify an event based on the cache.
            this.state = state;
        } finally {
            stateLock.unlock();
        }

        maybeCompleteInitialEndpointsFuture(state.endpoints());
        notifyListeners(state.endpoints());
    }
Creates a {@link XdsEndpointGroup} based on the specified {@link ClusterSnapshot}.
This may be useful if one would like to create an {@link EndpointGroup} based on
a {@link GrpcService}.
xds/src/main/java/com/linecorp/armeria/xds/client/endpoint/XdsEndpointGroup.java