Buggy code:
public String coreNodeName ; public String url ; public AbstractFullDistribZkTestBase . CloudSolrServerClient client ; public ZkNodeProps info ; @ Override public int hashCode ( ) { } @ Override public boolean equals ( Object obj ) { } } static class CloudSolrServerClient { SolrServer solrClient ; String shardName ; int port ; public ZkNodeProps info ; public CloudSolrServerClient ( ) { } public CloudSolrServerClient ( SolrServer client ) { } @ Override public int hashCode ( ) { } @ Override public boolean equals ( Object obj ) { } } @ Before @ Override public void setUp ( ) throws Exception { } @ BeforeClass public static void beforeClass ( ) { } @ AfterClass public static void afterClass ( ) { } public AbstractFullDistribZkTestBase ( ) { } protected void initCloud ( ) throws Exception { } protected CloudSolrServer createCloudClient ( String defaultCollection ) throws MalformedURLException { } @ Override protected void createServers ( int numServers ) throws Exception { } protected void waitForCollection ( ZkStateReader reader , String collection , int slices ) throws Exception { } protected List < JettySolrRunner > createJettys ( int numJettys ) throws Exception { } protected List < JettySolrRunner > createJettys ( int numJettys , boolean checkCreatedVsState ) throws Exception { } protected SolrServer startCloudJetty ( String collection , String shard ) throws Exception { } protected int getTotalReplicas ( String collection ) { } public JettySolrRunner createJetty ( String dataDir , String shardList , String solrConfigOverride ) throws Exception { } protected void updateMappingsFromZk ( List < JettySolrRunner > jettys , List < SolrServer > clients ) throws Exception { } private AbstractFullDistribZkTestBase . CloudSolrServerClient findClientByPort ( int port , List < AbstractFullDistribZkTestBase . CloudSolrServerClient > theClients ) { } @ Override protected void setDistributedParams ( ModifiableSolrParams params ) { } @ Override protected void indexDoc ( SolrInputDocument doc ) throws IOException , SolrServerException { } @ Override protected void index_specific ( int serverNumber , Object ... fields ) throws Exception { } protected void index_specific ( SolrServer client , Object ... fields ) throws Exception { } @ Override protected void del ( String q ) throws Exception { } protected void waitForRecoveriesToFinish ( boolean verbose ) throws Exception { } protected void waitForRecoveriesToFinish ( boolean verbose , int timeoutSeconds ) throws Exception { } protected void checkQueries ( ) throws Exception { } protected void indexAbunchOfDocs ( ) throws Exception { } protected void checkShardConsistency ( String shard ) throws Exception { } protected String checkShardConsistency ( String shard , boolean expectFailure , boolean verbose ) throws Exception { } private String toStr ( SolrDocumentList lst , int maxSz ) { } Set < Map > showDiff ( SolrDocumentList a , SolrDocumentList b , String aName , String bName ) { System . err . println ( ( ( ( "######" + aName ) + ":<seq2seq4repair_space>" ) + ( toStr ( a , 10 ) ) ) ) ; System . err . println ( ( ( ( "######" + bName ) + ":<seq2seq4repair_space>" ) + ( toStr ( b , 10 ) ) ) ) ; System . err . println ( ( ( ( "######<seq2seq4repair_space>sizes=" + ( a . size ( ) ) ) + "," ) + ( b . size ( ) ) ) ) ; Set < Map > setA = new HashSet < Map > ( ) ; for ( SolrDocument sdoc : a ) { setA . add ( new HashMap ( sdoc ) ) ; } Set < Map > setB = new HashSet < Map > ( ) ; for ( SolrDocument sdoc : b ) { setB . add ( new HashMap ( sdoc ) ) ; } Set < Map > onlyInA = new HashSet < Map > ( setA ) ; onlyInA . removeAll ( setB ) ; Set < Map > onlyInB = new HashSet < Map > ( setB ) ; onlyInB . removeAll ( setA ) ; if ( ( onlyInA . size ( ) ) > 0 ) { System . err . println ( ( ( ( "######<seq2seq4repair_space>Only<seq2seq4repair_space>in<seq2seq4repair_space>" + aName ) + ":<seq2seq4repair_space>" ) + onlyInA ) ) ; } if ( ( onlyInB . size ( ) ) > 0 ) { System . err . println ( ( ( ( "######<seq2seq4repair_space>Only<seq2seq4repair_space>in<seq2seq4repair_space>" + bName ) + ":<seq2seq4repair_space>" ) + onlyInB ) ) ; } <START_BUG> onlyInA . addAll ( b ) ; <END_BUG> return onlyInA ; } protected void checkShardConsistency ( ) throws Exception { } protected void checkShardConsistency ( boolean checkVsControl , boolean verbose ) throws Exception { } protected SolrServer getClient ( String nodeName ) { } protected void assertDocCounts ( boolean verbose ) throws Exception { } @ Override protected QueryResponse queryServer ( ModifiableSolrParams params ) throws SolrServerException { } abstract class StopableThread extends Thread { public StopableThread ( String name ) { } public abstract void safeStop ( ) { } } class StopableIndexingThread extends AbstractFullDistribZkTestBase . StopableThread { private volatile boolean stop = false ; protected final int startI ; protected final List < Integer > deletes = new ArrayList < Integer > ( ) ; protected final AtomicInteger fails = new AtomicInteger ( ) ; protected boolean doDeletes ; public StopableIndexingThread ( int startI , boolean doDeletes ) { } @ Override public void run ( ) { } @ Override public void safeStop ( ) { } public int getFails ( ) { } } class StopableSearchThread extends AbstractFullDistribZkTestBase . StopableThread { private volatile boolean stop = false ; protected final AtomicInteger fails = new AtomicInteger ( ) ; private String [ ] QUERIES = new String [ ] { "to<seq2seq4repair_space>come" , "their<seq2seq4repair_space>country" , "aid" , "co*" } ; public StopableSearchThread ( ) { } @ Override public void run ( ) { } @ Override public void safeStop ( ) { } public int getFails ( ) { } } public void waitForThingsToLevelOut ( int waitForRecTimeSeconds ) throws Exception { }

Fix:
onlyInA . addAll ( onlyInB ) ;