class StaticMasterReplicaTopologyProvider implements TopologyProvider {

    private static final InternalLogger logger = InternalLoggerFactory.getInstance(StaticMasterReplicaTopologyProvider.class);

    private final RedisClient redisClient;

    private final Iterable<RedisURI> redisURIs;

    public StaticMasterReplicaTopologyProvider(RedisClient redisClient, Iterable<RedisURI> redisURIs) {

        LettuceAssert.notNull(redisClient, "RedisClient must not be null");
        LettuceAssert.notNull(redisURIs, "RedisURIs must not be null");
        LettuceAssert.notNull(redisURIs.iterator().hasNext(), "RedisURIs must not be empty");

        this.redisClient = redisClient;
        this.redisURIs = redisURIs;
    }

    @Override
    @SuppressWarnings("rawtypes")
    public List<RedisNodeDescription> getNodes() {

        RedisURI next = redisURIs.iterator().next();

        try {
            return getNodesAsync().get(next.getTimeout().toMillis(), TimeUnit.MILLISECONDS);
        } catch (Exception e) {
            throw Exceptions.bubble(e);
        }
    }

    @Override
    public CompletableFuture<List<RedisNodeDescription>> getNodesAsync() {<FILL_FUNCTION_BODY>}

    private Mono<RedisNodeDescription> getNodeDescription(List<StatefulRedisConnection<String, String>> connections,
            RedisURI uri) {

        return Mono.fromCompletionStage(redisClient.connectAsync(StringCodec.UTF8, uri)) //
                .onErrorResume(t -> {

                    logger.warn("Cannot connect to {}", uri, t);
                    return Mono.empty();
                }) //
                .doOnNext(connections::add) //
                .flatMap(connection -> {

                    Mono<RedisNodeDescription> instance = getNodeDescription(uri, connection);

                    return instance.flatMap(it -> ResumeAfter.close(connection).thenEmit(it)).doFinally(s -> {
                        connections.remove(connection);
                    });
                });
    }

    private static Mono<RedisNodeDescription> getNodeDescription(RedisURI uri,
            StatefulRedisConnection<String, String> connection) {

        return connection.reactive().role().collectList().map(RoleParser::parse)
                .map(it -> new RedisMasterReplicaNode(uri.getHost(), uri.getPort(), uri, it.getRole()));
    }

}


        List<StatefulRedisConnection<String, String>> connections = new CopyOnWriteArrayList<>();

        Flux<RedisURI> uris = Flux.fromIterable(redisURIs);
        Mono<List<RedisNodeDescription>> nodes = uris.flatMap(uri -> getNodeDescription(connections, uri)).collectList()
                .flatMap((nodeDescriptions) -> {

                    if (nodeDescriptions.isEmpty()) {
                        return Mono.error(new RedisConnectionException(
                                String.format("Failed to connect to at least one node in %s", redisURIs)));
                    }

                    return Mono.just(nodeDescriptions);
                });

        return nodes.toFuture();
    
<no_super_class>