private void verifyAllPopped(int numEvents) throws Exception {
    Thread.sleep(1000);
    int lastNum = -1;
    for (; ; ) {
      int curNum = msgReceivedConsumer.getMsgs().size();
      if (curNum == lastNum) {
        break;
      } else if (0 <= curNum) {
        lastNum = curNum;
      }
      Thread.sleep(200);
    }

    Queue<Message<byte[]>> msgQ = msgReceivedConsumer.getMsgs();
    System.out.println("msgQ = " + outputStringsAsCommaDelim(msgQ));
    assertEquals(
        "Events didn't get on channel properly: " + outputStringsAsCommaDelim(msgQ),
        numEvents,
        msgQ.size());

    // testUtils.verifyWaitingQueue(0);
    // testUtils.verifyDeliveredQueue(0);
  }
 @Before
 public void setupTest() throws Exception {
   cq.truncate();
   msgReceivedConsumer.getMsgs().clear();
 }