@Test
  public void testAppendTTLWithACLTag() throws Exception {
    TableName tableName = TableName.valueOf(name.getMethodName());
    createTableWithCoprocessor(tableName, ChangeCellWithACLTagObserver.class.getName());
    try (Table table = connection.getTable(tableName)) {
      // Append without TTL
      Append firstAppend = new Append(ROW).addColumn(CF1_BYTES, CQ2, VALUE).setACL(USER, PERMS);
      Result result = table.append(firstAppend);
      assertEquals(1, result.size());
      assertTrue(Bytes.equals(VALUE, result.getValue(CF1_BYTES, CQ2)));

      // Check if the new cell can be read
      Get get = new Get(ROW).addColumn(CF1_BYTES, CQ2);
      result = table.get(get);
      assertEquals(1, result.size());
      assertTrue(Bytes.equals(VALUE, result.getValue(CF1_BYTES, CQ2)));

      // Append with TTL
      Append secondAppend =
        new Append(ROW).addColumn(CF1_BYTES, CQ2, VALUE).setTTL(1000).setACL(USER, PERMS);
      result = table.append(secondAppend);

      // We should get "valuevalue""
      assertEquals(1, result.size());
      assertTrue(Bytes.equals(VALUE2, result.getValue(CF1_BYTES, CQ2)));

      // Wait 4s to let the second append expire
      Thread.sleep(4000);
      get = new Get(ROW).addColumn(CF1_BYTES, CQ2);
      result = table.get(get);

      // The value should revert to "value"
      assertEquals(1, result.size());
      assertTrue(Bytes.equals(VALUE, result.getValue(CF1_BYTES, CQ2)));
    }
  }
Test coprocessor methods
{@link RegionObserver#postIncrementBeforeWAL(ObserverContext, Mutation, List)} and
{@link RegionObserver#postAppendBeforeWAL(ObserverContext, Mutation, List)}. These methods may
change the cells which will be applied to memstore and WAL. So add unit test for the case which
change the cell's column family and tags.
hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestPostIncrementAndAppendBeforeWAL.java