private void sendBatch() throws RemoteException {
   if (sampleStore.size() > 0) {
     listener.processBatch(sampleStore);
     sampleStore.clear();
     sampleTable.clear();
     sampleCount = 0;
   }
 }
 /**
  * Checks if any sample events are still present in the sampleStore and sends them to the
  * listener. Informs the listener of the testended.
  */
 public void testEnded() {
   try {
     if (sampleStore.size() != 0) {
       sendBatch();
     }
     listener.testEnded();
   } catch (RemoteException err) {
     log.warn("testEnded()", err);
   }
 }