### Question:
TableReporter { static void processRowResult(Result result, Sketches sketches) { long rowSize = 0; int columnCount = 0; for (Cell cell : result.rawCells()) { rowSize += estimatedSizeOfCell(cell); columnCount += 1; } sketches.rowSizeSketch.update(rowSize); sketches.columnCountSketch.update(columnCount); }  static long estimatedSizeOfCell(final Cell cell); static int estimatedSerializedSizeOf(final Cell cell); static void main(String [] args);  }### Answer:
@Test public void testSimpleSketching() { TableReporter.Sketches sketches = new TableReporter.Sketches(); final int rows = 10; final int columns = 3; final int versions = 2; for (int i = 0; i < rows; i++) { TableReporter.processRowResult(Result.create(makeCells(Bytes.toBytes(i), columns, versions)), sketches); } sketches.print(); double [] columnCounts = sketches.columnCountSketch.getQuantiles(new double [] {1}); assertEquals(columnCounts.length, 1); assertEquals((int)columnCounts[0], columns * versions); }
@Test public void testAddSketches() { TableReporter.Sketches sketches = new TableReporter.Sketches(); final int rows = 10; final int columns = 3; final int versions = 2; for (int i = 0; i < rows; i++) { TableReporter.processRowResult(Result.create(makeCells(Bytes.toBytes(i), columns, versions)), sketches); } sketches.print(); TableReporter.Sketches sketches2 = new TableReporter.Sketches(); for (int i = 0; i < rows; i++) { TableReporter.processRowResult(Result.create(makeCells(Bytes.toBytes(i), columns, versions)), sketches2); } sketches2.print(); TableReporter.AccumlatingSketch accumlator = new TableReporter.AccumlatingSketch(); accumlator.add(sketches); accumlator.add(sketches2); TableReporter.Sketches sum = accumlator.get(); double [] columnCounts = sum.columnCountSketch.getQuantiles(new double [] {1}); assertEquals(columnCounts.length, 1); assertEquals((int)columnCounts[0], columns * versions); sum.print(); }