class ClusterSlotRange implements Serializable {

    private int from;

    private int to;

    private RedisClusterNode upstream;

    private List<RedisClusterNode> replicaNodes = Collections.emptyList();

    public ClusterSlotRange() {
    }

    /**
     * Constructs a {@link ClusterSlotRange}
     *
     * @param from from slot
     * @param to to slot
     * @param upstream master for the slots, may be {@code null}
     * @param replicaNodes list of replicas must not be {@code null} but may be empty
     */
    public ClusterSlotRange(int from, int to, RedisClusterNode upstream, List<RedisClusterNode> replicaNodes) {

        LettuceAssert.notNull(upstream, "Upstream must not be null");
        LettuceAssert.notNull(replicaNodes, "ReplicaNodes must not be null");

        this.from = from;
        this.to = to;
        this.upstream = upstream;
        this.replicaNodes = replicaNodes;
    }

    private RedisClusterNode toRedisClusterNode(HostAndPort hostAndPort, String slaveOf, Set<RedisClusterNode.NodeFlag> flags) {

        int port = hostAndPort.hasPort() ? hostAndPort.getPort() : RedisURI.DEFAULT_REDIS_PORT;
        RedisClusterNode redisClusterNode = new RedisClusterNode();
        redisClusterNode.setUri(RedisURI.create(hostAndPort.getHostText(), port));
        redisClusterNode.setSlaveOf(slaveOf);
        redisClusterNode.setFlags(flags);
        return redisClusterNode;
    }

    private List<RedisClusterNode> toRedisClusterNodes(List<HostAndPort> hostAndPorts, String slaveOf,
            Set<RedisClusterNode.NodeFlag> flags) {<FILL_FUNCTION_BODY>}

    public int getFrom() {
        return from;
    }

    public int getTo() {
        return to;
    }

    public RedisClusterNode getUpstream() {
        return upstream;
    }

    public void setUpstream(RedisClusterNode upstream) {
        this.upstream = upstream;
    }

    @Deprecated
    public List<RedisClusterNode> getSlaveNodes() {
        return replicaNodes;
    }

    @Deprecated
    public void setSlaveNodes(List<RedisClusterNode> slaveNodes) {
        this.replicaNodes = slaveNodes;
    }

    public List<RedisClusterNode> getReplicaNodes() {
        return replicaNodes;
    }

    public void setReplicaNodes(List<RedisClusterNode> replicaNodes) {
        this.replicaNodes = replicaNodes;
    }

    public void setFrom(int from) {
        this.from = from;
    }

    public void setTo(int to) {
        this.to = to;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [from=").append(from);
        sb.append(", to=").append(to);
        sb.append(", masterNode=").append(upstream);
        sb.append(", replicaNodes=").append(replicaNodes);
        sb.append(']');
        return sb.toString();
    }

}

        List<RedisClusterNode> result = new ArrayList<>();
        for (HostAndPort hostAndPort : hostAndPorts) {
            result.add(toRedisClusterNode(hostAndPort, slaveOf, flags));
        }
        return result;
    
<no_super_class>