private static <E> void drainTo(final RegionNormalizerWorkQueue<E> queue, Collection<E> dest)
    throws InterruptedException {
    assertThat(queue.size(), greaterThan(0));
    while (queue.size() > 0) {
      dest.add(queue.take());
    }
  }
Test that calls to {@link RegionNormalizerWorkQueue#take()} block the requesting thread. The
producing thread places new entries onto the queue following a known schedule. The consuming
thread collects a time measurement between calls to {@code take}. Finally, the test makes
coarse-grained assertions of the consumer's observations based on the producer's schedule.
hbase-server/src/test/java/org/apache/hadoop/hbase/master/normalizer/TestRegionNormalizerWorkQueue.java