public void processTestClass(TestClassRunInfo testClass) {
   if (processor == null) {
     processor = factory.create();
     processor.startProcessing(resultProcessor);
   }
   processor.processTestClass(testClass);
   testCount++;
   if (testCount == restartEvery) {
     endBatch();
   }
 }
 private void endBatch() {
   try {
     processor.stop();
   } finally {
     processor = null;
     testCount = 0;
   }
 }