@Test
  public void testListPartitioning() {
    // 10 Bytes
    ZKUtilOp tenByteOp = ZKUtilOp.deleteNodeFailSilent("/123456789");

    // Simple, single element case
    assertEquals(Collections.singletonList(Collections.singletonList(tenByteOp)),
      ZKUtil.partitionOps(Collections.singletonList(tenByteOp), 15));

    // Simple case where we exceed the limit, but must make the list
    assertEquals(Collections.singletonList(Collections.singletonList(tenByteOp)),
      ZKUtil.partitionOps(Collections.singletonList(tenByteOp), 5));

    // Each gets its own bucket
    assertEquals(
      Arrays.asList(Collections.singletonList(tenByteOp), Collections.singletonList(tenByteOp),
        Collections.singletonList(tenByteOp)),
      ZKUtil.partitionOps(Arrays.asList(tenByteOp, tenByteOp, tenByteOp), 15));

    // Test internal boundary
    assertEquals(
      Arrays.asList(Arrays.asList(tenByteOp, tenByteOp), Collections.singletonList(tenByteOp)),
      ZKUtil.partitionOps(Arrays.asList(tenByteOp, tenByteOp, tenByteOp), 20));

    // Plenty of space for one partition
    assertEquals(Collections.singletonList(Arrays.asList(tenByteOp, tenByteOp, tenByteOp)),
      ZKUtil.partitionOps(Arrays.asList(tenByteOp, tenByteOp, tenByteOp), 50));
  }
Verifies that for the given root node, it should delete all the nodes recursively using
multi-update api.
hbase-zookeeper/src/test/java/org/apache/hadoop/hbase/zookeeper/TestZKMulti.java