@Test
  public void testOverlappingKeys() {
    byte[] empty = HConstants.EMPTY_BYTE_ARRAY;
    byte[] a = Bytes.toBytes("a");
    byte[] b = Bytes.toBytes("b");
    byte[] c = Bytes.toBytes("c");
    byte[] d = Bytes.toBytes("d");

    // overlaps
    Assert.assertTrue(PrivateCellUtil.overlappingKeys(a, b, a, b));
    Assert.assertTrue(PrivateCellUtil.overlappingKeys(a, c, a, b));
    Assert.assertTrue(PrivateCellUtil.overlappingKeys(a, b, a, c));
    Assert.assertTrue(PrivateCellUtil.overlappingKeys(b, c, a, c));
    Assert.assertTrue(PrivateCellUtil.overlappingKeys(a, c, b, c));
    Assert.assertTrue(PrivateCellUtil.overlappingKeys(a, d, b, c));
    Assert.assertTrue(PrivateCellUtil.overlappingKeys(b, c, a, d));

    Assert.assertTrue(PrivateCellUtil.overlappingKeys(empty, b, a, b));
    Assert.assertTrue(PrivateCellUtil.overlappingKeys(empty, b, a, c));

    Assert.assertTrue(PrivateCellUtil.overlappingKeys(a, b, empty, b));
    Assert.assertTrue(PrivateCellUtil.overlappingKeys(a, b, empty, c));

    Assert.assertTrue(PrivateCellUtil.overlappingKeys(a, empty, a, b));
    Assert.assertTrue(PrivateCellUtil.overlappingKeys(a, empty, a, c));

    Assert.assertTrue(PrivateCellUtil.overlappingKeys(a, b, empty, empty));
    Assert.assertTrue(PrivateCellUtil.overlappingKeys(empty, empty, a, b));

    // non overlaps
    Assert.assertFalse(PrivateCellUtil.overlappingKeys(a, b, c, d));
    Assert.assertFalse(PrivateCellUtil.overlappingKeys(c, d, a, b));

    Assert.assertFalse(PrivateCellUtil.overlappingKeys(b, c, c, d));
    Assert.assertFalse(PrivateCellUtil.overlappingKeys(b, c, c, empty));
    Assert.assertFalse(PrivateCellUtil.overlappingKeys(b, c, d, empty));
    Assert.assertFalse(PrivateCellUtil.overlappingKeys(c, d, b, c));
    Assert.assertFalse(PrivateCellUtil.overlappingKeys(c, empty, b, c));
    Assert.assertFalse(PrivateCellUtil.overlappingKeys(d, empty, b, c));

    Assert.assertFalse(PrivateCellUtil.overlappingKeys(b, c, a, b));
    Assert.assertFalse(PrivateCellUtil.overlappingKeys(b, c, empty, b));
    Assert.assertFalse(PrivateCellUtil.overlappingKeys(b, c, empty, a));
    Assert.assertFalse(PrivateCellUtil.overlappingKeys(a, b, b, c));
    Assert.assertFalse(PrivateCellUtil.overlappingKeys(empty, b, b, c));
    Assert.assertFalse(PrivateCellUtil.overlappingKeys(empty, a, b, c));
  }
Was overflowing if 100k or so lists of cellscanners to return.
hbase-common/src/test/java/org/apache/hadoop/hbase/TestCellUtil.java