@Test
  public void testForceCopyOfBigCellInto() {
    Configuration conf = HBaseConfiguration.create();
    int chunkSize = ChunkCreator.getInstance().getChunkSize();
    conf.setInt(CHUNK_SIZE_KEY, chunkSize);
    conf.setInt(MAX_ALLOC_KEY, chunkSize / 2);

    MemStoreLABImpl mslab = new MemStoreLABImpl(conf);
    byte[] row = Bytes.toBytes("row");
    byte[] columnFamily = Bytes.toBytes("columnFamily");
    byte[] qualify = Bytes.toBytes("qualify");
    byte[] smallValue = new byte[chunkSize / 2];
    byte[] bigValue = new byte[chunkSize];
    KeyValue smallKV =
      new KeyValue(row, columnFamily, qualify, EnvironmentEdgeManager.currentTime(), smallValue);

    assertEquals(smallKV.getSerializedSize(),
      mslab.forceCopyOfBigCellInto(smallKV).getSerializedSize());

    KeyValue bigKV =
      new KeyValue(row, columnFamily, qualify, EnvironmentEdgeManager.currentTime(), bigValue);
    assertEquals(bigKV.getSerializedSize(),
      mslab.forceCopyOfBigCellInto(bigKV).getSerializedSize());

    /**
     * Add test by HBASE-26576,all the chunks are in {@link ChunkCreator#chunkIdMap}
     */
    assertTrue(mslab.chunks.size() == 2);
    Chunk dataChunk = null;
    Chunk jumboChunk = null;

    for (Integer chunkId : mslab.chunks) {
      Chunk chunk = ChunkCreator.getInstance().getChunk(chunkId);
      assertTrue(chunk != null);
      if (chunk.getChunkType() == ChunkType.JUMBO_CHUNK) {
        jumboChunk = chunk;
      } else if (chunk.getChunkType() == ChunkType.DATA_CHUNK) {
        dataChunk = chunk;
      }
    }

    assertTrue(dataChunk != null);
    assertTrue(jumboChunk != null);

    mslab.close();
    /**
     * After mslab close, jumboChunk is removed from {@link ChunkCreator#chunkIdMap} but because
     * dataChunk is recycled to pool so it is still in {@link ChunkCreator#chunkIdMap}.
     */
    assertTrue(ChunkCreator.getInstance().getChunk(jumboChunk.getId()) == null);
    assertTrue(!ChunkCreator.getInstance().isChunkInPool(jumboChunk.getId()));
    assertTrue(ChunkCreator.getInstance().getChunk(dataChunk.getId()) == dataChunk);
    assertTrue(ChunkCreator.getInstance().isChunkInPool(dataChunk.getId()));

  }
Test cell with right length, which constructed by testForceCopyOfBigCellInto. (HBASE-26467)
hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMemStoreLAB.java