  @Test(timeout = 2000)
  public void testWaitForConsume() throws InterruptedException {

    long start = System.currentTimeMillis();
    new Thread() {
      @Override
      @SneakyThrows
      public void run() {
        sleep(500);
        addTraces(2);
      }
    }.start();
    queue.consume();

    long total = System.currentTimeMillis() - start;
    Assert.assertTrue(total>=500);
  }