public void tearDown() throws Exception {
   if (runner != null) {
     runner.cancel();
   }
   if (resequencer != null) {
     resequencer.stop();
   }
 }
 private void initResequencer(long timeout, int capacity) {
   ResequencerEngine<Integer> engine;
   buffer = new SequenceBuffer<Integer>();
   engine = new ResequencerEngine<Integer>(new IntegerComparator());
   engine.setSequenceSender(buffer);
   engine.setTimeout(timeout);
   engine.start();
   resequencer = new ResequencerEngineSync<Integer>(engine);
   runner = new ResequencerRunner<Integer>(resequencer, 50);
   runner.start();
 }