### Question:
KnoxShellTable { public KnoxShellTableAggregator aggregate() { return new KnoxShellTableAggregator(this); } KnoxShellTable(); KnoxShellTable title(String title); KnoxShellTable header(String header); KnoxShellTable row(); KnoxShellTable value(Comparable<? extends Object> value); KnoxShellTableCell<? extends Comparable<? extends Object>> cell(int colIndex, int rowIndex); List<Comparable<? extends Object>> values(int colIndex); List<Comparable<? extends Object>> values(String colName); double mean(String colName); double mean(int colIndex); double median(String colName); double median(int colIndex); double mode(String colName); double mode(int colIndex); double sum(String colName); double sum(int colIndex); double max(String colName); double max(int colIndex); double min(String colName); double min(int colIndex); KnoxShellTable apply(KnoxShellTableCell<? extends Comparable<? extends Object>> cell); List<String> getHeaders(); List<List<Comparable<? extends Object>>> getRows(); String getTitle(); long getId(); static KnoxShellTableBuilder builder(); List<KnoxShellTableCall> getCallHistoryList(); String getCallHistory(); String rollback(); KnoxShellTable replayAll(); KnoxShellTable replay(int step); static KnoxShellTable replay(long id, int step); KnoxShellTableFilter filter(); KnoxShellTableAggregator aggregate(); KnoxShellTable select(String cols); KnoxShellTable sort(String colName); KnoxShellTable sortNumeric(String colName); KnoxShellTable sort(String colName, SortOrder order); KnoxShellTable sort(List<Comparable<? extends Object>> col,
      SortOrder order); @Override String toString(); String toJSON(); String toJSON(boolean data); String toJSON(String path); String toJSON(boolean data, String path); String toCSV(); String toCSV(String filePath);  }### Answer:
@Test public void testAggregate() throws Exception { KnoxShellTable TABLE = new KnoxShellTable(); TABLE.header("A").header("B").header("C"); TABLE.row().value(100).value("200").value(300); TABLE.row().value(200).value("300").value(400); TABLE.row().value(200).value("400").value(500); KnoxShellTable report = TABLE.aggregate().columns("A,B,C").functions("min,max,mean,median,mode,sum"); assertEquals(100.0, report.cell(1,0).value); assertEquals(200.0, report.cell(1,1).value); assertEquals(166.66666666666666, report.cell(1,2).value); assertEquals(200.0, report.cell(1,3).value); assertEquals(200.0, report.cell(1,4).value); assertEquals(500.0, report.cell(1,5).value); }