@Test
public void testManyCells() {

  FlatRow simpleRow =
      FlatRow.newBuilder()
          .withRowKey(toByteString("key"))
          .addCell("family1", toByteString("column"), 500, toByteString("value"), null)
          .addCell("family1", toByteString("column2"), 500, toByteString("value"), null)
          .addCell("family1", toByteString("column2"), 400, toByteString("value"), null)
          .addCell("family2", toByteString("column"), 500, toByteString("value"), null)
          .build();
  FlatRow.Cell simpleCell0 = simpleRow.getCells().get(0);
  FlatRow.Cell simpleCell1 = simpleRow.getCells().get(1);
  FlatRow.Cell simpleCell2 = simpleRow.getCells().get(2);
  FlatRow.Cell simpleCell3 = simpleRow.getCells().get(3);
  Row expectedRow =
      Row.newBuilder()
          .setKey(simpleRow.getRowKey())
          .addFamilies(
              Family.newBuilder()
                  .setName(simpleCell0.getFamily())
                  .addColumns(
                      Column.newBuilder()
                          .setQualifier(simpleCell0.getQualifier())
                          .addCells(asProtoCell(simpleCell0))
                          .build())
                  .addColumns(
                      Column.newBuilder()
                          .setQualifier(simpleCell1.getQualifier())
                          .addCells(asProtoCell(simpleCell1))
                          .addCells(asProtoCell(simpleCell2))
                          .build())
                  .build())
          .addFamilies(
              Family.newBuilder()
                  .setName(simpleCell3.getFamily())
                  .addColumns(
                      Column.newBuilder()
                          .setQualifier(simpleCell3.getQualifier())
                          .addCells(asProtoCell(simpleCell3))
                          .build()))
          .build();
  Assert.assertEquals(expectedRow, FlatRowConverter.convert(simpleRow));
}