@Test
public void testFamilyOrdering() {

  RowAdapter.RowBuilder<Result> rowBuilder = underTest.createRowBuilder();
  rowBuilder.startRow(ROW_KEY);
  rowBuilder.startCell("cc", QUAL_ONE, 20000L, LABELS, -1);
  rowBuilder.cellValue(VALUE);
  rowBuilder.finishCell();
  rowBuilder.startCell("bb", QUAL_TWO, 40000L, LABELS, VALUE.size() * 2);
  rowBuilder.cellValue(VALUE);
  rowBuilder.cellValue(VALUE);
  rowBuilder.finishCell();
  rowBuilder.startCell("aa", QUAL_ONE, 20000L, LABELS, VALUE.size());
  rowBuilder.cellValue(VALUE);
  rowBuilder.finishCell();
  rowBuilder.startCell("zz", QUAL_ONE, 80000L, LABELS, VALUE.size());
  rowBuilder.cellValue(VALUE);
  rowBuilder.finishCell();
  rowBuilder.startCell("b", QUAL_ONE, 10000L, LABELS, VALUE.size());
  rowBuilder.cellValue(VALUE);
  rowBuilder.finishCell();
  Result actualResult = rowBuilder.finishRow();
  List<String> colFamilyInActualOrder = new ArrayList<>(5);
  for (Cell cell : actualResult.listCells()) {
    colFamilyInActualOrder.add(Bytes.toString(CellUtil.cloneFamily(cell)));
  }
  assertEquals(ImmutableList.of("aa", "b", "bb", "cc", "zz"), colFamilyInActualOrder);
}