### Question:
ServerConfiguration { @Bean public RedisServerMasterCluster redisServerMasterCluster(RedisProxyConfiguration redisProxyConfiguration, @Qualifier("loadMasterBalance") LoadBalance loadMasterBalance, @Qualifier("loadSlaveBalance") LoadBalance loadSlaveBalance){ List<RedisServerClusterBean> list = new ArrayList<>(); RedisProxyPoolConfig poolConfig =redisProxyConfiguration.getRedisPool(); List<RedisProxyMaster> masters =redisProxyConfiguration.getGroupNode().get(0).getRedisMasters(); for(RedisProxyMaster master : masters){ RedisServerBean redisServerBean = new RedisServerBean(); redisServerBean.setRedisPoolConfig(poolConfig); redisServerBean.setHost(master.getHost()); redisServerBean.setPort(master.getPort()); RedisServerClusterBean redisServerClusterBean= new RedisServerClusterBean(); redisServerClusterBean.setRedisServerMasterBean(redisServerBean); redisServerClusterBean.setLoadClusterBalance(loadSlaveBalance); if(master.getRedisSlaves()!=null){ List<RedisServerBean> slaves = new ArrayList<>(); for(RedisProxySlave slave :master.getRedisSlaves()){ RedisServerBean redisSlaveServerBean = new RedisServerBean(); redisSlaveServerBean.setRedisPoolConfig(poolConfig); redisSlaveServerBean.setHost(slave.getHost()); redisSlaveServerBean.setPort(slave.getPort()); slaves.add(redisSlaveServerBean); } redisServerClusterBean.setRedisServerSlaveBeans(slaves); } list.add(redisServerClusterBean); } RedisServerMasterCluster redisServerMasterCluster = new RedisServerMasterCluster(list); redisServerMasterCluster.setLoadMasterBalance(loadMasterBalance); return redisServerMasterCluster; } ServerConfiguration(ConfigurableEnvironment env); @Bean(name="loadMasterBalance") LoadBalance consistentHashLoadBalance(); @Bean(name="loadSlaveBalance") LoadBalance roundRobinLoadBalance(); @Bean RedisServerMasterCluster redisServerMasterCluster(RedisProxyConfiguration redisProxyConfiguration, @Qualifier("loadMasterBalance") LoadBalance loadMasterBalance, @Qualifier("loadSlaveBalance") LoadBalance loadSlaveBalance); @Bean Server server(); @Bean @ConditionalOnMissingBean(value = EurekaInstanceConfig.class, search = SearchStrategy.CURRENT) EurekaInstanceConfigBean eurekaInstanceConfigBean(InetUtils inetUtils,Server server);  }### Answer:
@Test public void redisServerMasterCluster() { assertNotNull(redisServerMasterCluster); List<RedisServerBean> masters = redisServerMasterCluster.getMasters(); LoadBalance loadBalance = redisServerMasterCluster.getLoadMasterBalance(); List<RedisServerBean> slaves = redisServerMasterCluster.getMasterFfanRedisServerBean(masters.get(0).getKey()); assertEquals(1,masters.size()); assertEquals(2,slaves.size()); assertTrue(loadBalance instanceof ConsistentHashLoadBalance); }