Mutation add(Cell cell) throws IOException {
    // Checking that the row of the kv is the same as the mutation
    // TODO: It is fraught with risk if user pass the wrong row.
    // Throwing the IllegalArgumentException is more suitable I'd say.
    if (!CellUtil.matchingRows(cell, this.row)) {
      throw new WrongRowIOException("The row in " + cell.toString()
        + " doesn't match the original one " + Bytes.toStringBinary(this.row));
    }

    byte[] family;

    if (cell instanceof IndividualBytesFieldCell) {
      family = cell.getFamilyArray();
    } else {
      family = CellUtil.cloneFamily(cell);
    }

    if (family == null || family.length == 0) {
      throw new IllegalArgumentException("Family cannot be null");
    }

    if (cell instanceof ExtendedCell) {
      getCellList(family).add((ExtendedCell) cell);
    } else {
      throw new IllegalArgumentException("Unsupported cell type: " + cell.getClass().getName());
    }
    return this;
  }
@param row Row to check
@throws IllegalArgumentException Thrown if <code>row</code> is empty or null or &gt;
                                 {@link HConstants#MAX_ROW_LENGTH}
@return <code>row</code>
hbase-client/src/main/java/org/apache/hadoop/hbase/client/Mutation.java