@Test
  public void testElementUniquenessAndFIFO() throws Exception {
    final RegionNormalizerWorkQueue<Integer> queue = new RegionNormalizerWorkQueue<>();
    final List<Integer> content = new LinkedList<>();
    IntStream.of(4, 3, 2, 1, 4, 3, 2, 1).boxed().forEach(queue::put);
    assertEquals(4, queue.size());
    while (queue.size() > 0) {
      content.add(queue.take());
    }
    assertThat(content, contains(4, 3, 2, 1));

    queue.clear();
    queue.putAll(Arrays.asList(4, 3, 2, 1));
    queue.putAll(Arrays.asList(4, 5));
    assertEquals(5, queue.size());
    content.clear();
    while (queue.size() > 0) {
      content.add(queue.take());
    }
    assertThat(content, contains(4, 3, 2, 1, 5));
  }
Tests that {@link RegionNormalizerWorkQueue} implements the contract described in its docstring.
hbase-server/src/test/java/org/apache/hadoop/hbase/master/normalizer/TestRegionNormalizerWorkQueue.java