public void add(Map<byte[], List<Cell>> familyMap) {
    for (Map.Entry<byte[], List<Cell>> e : familyMap.entrySet()) {
      // 'foreach' loop NOT used. See HBASE-12023 "...creates too many iterator objects."
      int listSize = e.getValue().size();
      // Add all Cells first and then at end, add the family rather than call {@link #add(Cell)}
      // and have it clone family each time. Optimization!
      for (int i = 0; i < listSize; i++) {
        addCell(PrivateCellUtil.ensureExtendedCell(e.getValue().get(i)));
      }
      addFamily(e.getKey());
    }
  }
This is just for keeping compatibility for CPs, in HBase you should call the below
{@link #addMap(Map)} directly to avoid casting.
hbase-server/src/main/java/org/apache/hadoop/hbase/wal/WALEdit.java