@Test
  public void testRowMutations() throws InterruptedException, IOException {
    Put put = new Put(Bytes.toBytes("good")).addColumn(FAMILY, null, new byte[1]);
    List<Row> batches = new ArrayList<>();
    RowMutations mutations = new RowMutations(Bytes.toBytes("fail"));
    // the first and second puts will be group by regionserver
    mutations.add(new Put(Bytes.toBytes("fail")).addColumn(FAMILY, null, new byte[CELL_SIZE]));
    mutations.add(new Put(Bytes.toBytes("fail")).addColumn(FAMILY, null, new byte[CELL_SIZE]));
    batches.add(mutations);
    // this bm should succeed
    mutations = new RowMutations(Bytes.toBytes("good"));
    mutations.add(put);
    mutations.add(put);
    batches.add(mutations);
    Object[] objs = new Object[batches.size()];
    try (Table table = TEST_UTIL.getConnection().getTable(TABLE_NAME)) {
      table.batch(batches, objs);
      fail("Where is the exception? We put the malformed cells!!!");
    } catch (RetriesExhaustedException e) {
      Throwable error = e.getCause();
      for (;;) {
        assertNotNull("Can not find a DoNotRetryIOException on stack trace", error);
        if (error instanceof DoNotRetryIOException) {
          break;
        }
        error = error.getCause();
      }
    } finally {
      assertObjects(objs, batches.size());
      assertTrue(objs[0] instanceof IOException);
      assertEquals(Result.class, objs[1].getClass());
    }
  }
This test depends on how regionserver process the batch ops. 1) group the put/delete until
meeting the increment 2) process the batch of put/delete 3) process the increment see
RSRpcServices#doNonAtomicRegionMutation
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMalformedCellFromClient.java