### Question:
HTableUtil { public static void bucketRsBatch(HTable htable, List<Row> rows) throws IOException { try { Map<String, List<Row>> rowMap = createRsRowMap(htable, rows); for (List<Row> rsRows: rowMap.values()) { htable.batch( rsRows ); } } catch (InterruptedException e) { throw new IOException(e); } }  static void bucketRsPut(HTable htable, List<Put> puts); static void bucketRsBatch(HTable htable, List<Row> rows);  }### Answer:
@Test public void testBucketBatch() throws Exception { byte [] TABLE = Bytes.toBytes("testBucketBatch"); HTable ht = TEST_UTIL.createTable(TABLE, FAMILY); List<Row> rows = new ArrayList<Row>(); rows.add( createPut("row1") ); rows.add( createPut("row2") ); rows.add( createPut("row3") ); rows.add( createPut("row4") ); HTableUtil.bucketRsBatch( ht, rows ); Scan scan = new Scan(); scan.addColumn(FAMILY, QUALIFIER); int count = 0; for(Result result : ht.getScanner(scan)) { count++; } LOG.info("bucket batch count=" + count); assertEquals(count, rows.size()); ht.close(); }