question: private static void generateEvents ( ) throws Exception { String regionName = Region . SEPARATOR + REGION_NAME ; Region region = cache . getRegion ( regionName ) ; for ( int i = 0 ; i < TOTAL_PUTS ; i ++ ) { region . put ( "key" + i , "val-" + i ) ; } Thread . sleep ( DISPATCHER_SLOWSTART_TIME + 1000 ) ; for ( int i = 0 ; i < 25 ; i ++ ) { region . put ( LAST_KEY , "LAST_VALUE" ) ; } }
target:  First generates some events, then waits for the time equal to that of delayed start of the dispatcher and then does put on the last key for few iterations. The idea is to let the events added, before waiting, to expire before the dispatcher to pick them up and then do a put on a LAST_KEY couple of times so that atleast one of these is dispatched to client and when client recieves this in the listener, the test is notified to proceed for validation.