diff --git a/core/src/test/java/org/elasticsearch/action/support/broadcast/node/TransportBroadcastByNodeActionTests.java b/core/src/test/java/org/elasticsearch/action/support/broadcast/node/TransportBroadcastByNodeActionTests.java index 846d6373499..39aaf166c3e 100644 --- a/core/src/test/java/org/elasticsearch/action/support/broadcast/node/TransportBroadcastByNodeActionTests.java +++ b/core/src/test/java/org/elasticsearch/action/support/broadcast/node/TransportBroadcastByNodeActionTests.java @@ -310,7 +310,7 @@ public class TransportBroadcastByNodeActionTests extends ESTestCase { ShardsIterator shardIt = clusterService.state().routingTable().allShards(new String[]{TEST_INDEX}); Set set = new HashSet<>(); for (ShardRouting shard : shardIt.asUnordered()) { - if (shard.currentNodeId() != masterNode.id()) { + if (!shard.currentNodeId().equals(masterNode.id())) { set.add(shard.currentNodeId()); } }