diff --git a/solr/core/src/test/org/apache/solr/cloud/ChaosMonkey.java b/solr/core/src/test/org/apache/solr/cloud/ChaosMonkey.java index ac6488394e0..34f54679fc9 100644 --- a/solr/core/src/test/org/apache/solr/cloud/ChaosMonkey.java +++ b/solr/core/src/test/org/apache/solr/cloud/ChaosMonkey.java @@ -19,7 +19,6 @@ package org.apache.solr.cloud; import java.net.BindException; import java.util.ArrayList; -import java.util.Collection; import java.util.List; import java.util.Map; import java.util.Random; @@ -297,13 +296,7 @@ public class ChaosMonkey { JettySolrRunner jetty; if (chance <= 5 && aggressivelyKillLeaders) { // if killLeader, really aggressively go after leaders - Collection leaders = shardToLeaderJetty.values(); - List leadersList = new ArrayList(leaders.size()); - - leadersList.addAll(leaders); - - int index = random.nextInt(leadersList.size()); - jetty = leadersList.get(index).jetty; + jetty = shardToLeaderJetty.get(slice).jetty; } else { // get random shard List jetties = shardToJetty.get(slice);