Buggy code:
public class AntiEntropyService { private static final Logger logger = LoggerFactory . getLogger ( AntiEntropyService . class ) ; public static final AntiEntropyService instance = new AntiEntropyService ( ) ; private static final ThreadPoolExecutor executor ; private final ConcurrentMap < String , AntiEntropyService . RepairSession > sessions ; protected AntiEntropyService ( ) { } public AntiEntropyService . RepairFuture submitRepairSession ( Range range , String tablename , String ... cfnames ) { } AntiEntropyService . RepairFuture submitArtificialRepairSession ( AntiEntropyService . TreeRequest req , String tablename , String ... cfnames ) { } static Set < InetAddress > getNeighbors ( String table , Range range ) { } private void rendezvous ( AntiEntropyService . TreeRequest request , MerkleTree tree ) { } AntiEntropyService . TreeRequest request ( String sessionid , InetAddress remote , Range range , String ksname , String cfname ) { } void respond ( AntiEntropyService . Validator validator , InetAddress local ) { } public static class Validator implements Runnable { public final AntiEntropyService . TreeRequest request ; public final MerkleTree tree ; private transient List < MerkleTree . RowHash > minrows ; private transient long validated ; private transient TreeRange range ; private transient TreeRangeIterator ranges ; private transient DecoratedKey lastKey ; public static final RowHash EMPTY_ROW = new MerkleTree . RowHash ( null , new byte [ 0 ] ) ; Validator ( AntiEntropyService . TreeRequest request ) { } Validator ( AntiEntropyService . TreeRequest request , MerkleTree tree ) { } public void prepare ( ColumnFamilyStore cfs ) { if ( ( tree . partitioner ( ) ) instanceof RandomPartitioner ) { tree . init ( ) ; } else { List < DecoratedKey > keys = new ArrayList < DecoratedKey > ( ) ; for ( DecoratedKey sample : cfs . keySamples ( request . range ) ) { <START_BUG> assert request . range . contains ( sample . token ) ; <END_BUG> keys . add ( sample ) ; } if ( keys . isEmpty ( ) ) { tree . init ( ) ; } else { int numkeys = keys . size ( ) ; Random random = new Random ( ) ; while ( true ) { DecoratedKey dk = keys . get ( random . nextInt ( numkeys ) ) ; if ( ! ( tree . split ( dk . token ) ) ) break ; } } } AntiEntropyService . logger . debug ( ( ( ( "Prepared<seq2seq4repair_space>AEService<seq2seq4repair_space>tree<seq2seq4repair_space>of<seq2seq4repair_space>size<seq2seq4repair_space>" + ( tree . size ( ) ) ) + "<seq2seq4repair_space>for<seq2seq4repair_space>" ) + ( request ) ) ) ; ranges = tree . invalids ( ) ; } public void add ( AbstractCompactedRow row ) { } private RowHash rowHash ( AbstractCompactedRow row ) { } public void complete ( ) { } void completeTree ( ) { } public void run ( ) { } } public static class TreeRequestVerbHandler implements ICompactSerializer < AntiEntropyService . TreeRequest > , IVerbHandler { public static final AntiEntropyService . TreeRequestVerbHandler SERIALIZER = new AntiEntropyService . TreeRequestVerbHandler ( ) ; static Message makeVerb ( AntiEntropyService . TreeRequest request , int version ) { } public void serialize ( AntiEntropyService . TreeRequest request , DataOutputStream dos , int version ) throws IOException { } public AntiEntropyService . TreeRequest deserialize ( DataInputStream dis , int version ) throws IOException { } public void doVerb ( Message message , String id ) { } } public static class TreeResponseVerbHandler implements ICompactSerializer < AntiEntropyService . Validator > , IVerbHandler { public static final AntiEntropyService . TreeResponseVerbHandler SERIALIZER = new AntiEntropyService . TreeResponseVerbHandler ( ) ; static Message makeVerb ( InetAddress local , AntiEntropyService . Validator validator ) { } public void serialize ( AntiEntropyService . Validator v , DataOutputStream dos , int version ) throws IOException { } public AntiEntropyService . Validator deserialize ( DataInputStream dis , int version ) throws IOException { } public void doVerb ( Message message , String id ) { } } static class CFPair extends Pair < String , String > { public CFPair ( String table , String cf ) { } } static class TreePair extends Pair < MerkleTree , MerkleTree > { public TreePair ( MerkleTree local , MerkleTree remote ) { } } public static class TreeRequest { public final String sessionid ; public final InetAddress endpoint ; public final Range range ; public final AntiEntropyService . CFPair cf ; public TreeRequest ( String sessionid , InetAddress endpoint , Range range , AntiEntropyService . CFPair cf ) { } @ Override public final int hashCode ( ) { } @ Override public final boolean equals ( Object o ) { } @ Override public String toString ( ) { } } class RepairSession extends WrappedRunnable implements IEndpointStateChangeSubscriber , IFailureDetectionEventListener { private final String sessionName ; private final String tablename ; private final String [ ] cfnames ; private final Range range ; private volatile Exception exception ; private final AtomicBoolean isFailed = new AtomicBoolean ( false ) ; private final Set < InetAddress > endpoints ; final Queue < AntiEntropyService . RepairSession . RepairJob > jobs = new ConcurrentLinkedQueue < AntiEntropyService . RepairSession . RepairJob > ( ) ; final Map < String , AntiEntropyService . RepairSession . RepairJob > activeJobs = new ConcurrentHashMap < String , AntiEntropyService . RepairSession . RepairJob > ( ) ; private final SimpleCondition completed = new SimpleCondition ( ) ; public final Condition differencingDone = new SimpleCondition ( ) ; public RepairSession ( AntiEntropyService . TreeRequest req , String tablename , String ... cfnames ) { } public RepairSession ( Range range , String tablename , String ... cfnames ) { } private RepairSession ( String id , Range range , String tablename , String [ ] cfnames ) { } public String getName ( ) { } AntiEntropyService . RepairFuture getFuture ( ) { } public void runMayThrow ( ) throws Exception { } void completed ( InetAddress remote , String cfname ) { }

Fix:
assert request . range . contains ( sample . token ) : ( ( "Token<seq2seq4repair_space>" + ( sample . token ) ) + "<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>within<seq2seq4repair_space>range<seq2seq4repair_space>" ) + ( request . range ) ;