TableSliceGroup implements Iterable<TableSlice> { public Table aggregate(String colName1, AggregateFunction<?, ?>... functions) { ArrayListMultimap<String, AggregateFunction<?, ?>> columnFunctionMap = ArrayListMultimap.create(); columnFunctionMap.putAll(colName1, Lists.newArrayList(functions)); return aggregate(columnFunctionMap); } protected  TableSliceGroup(Table original); protected  TableSliceGroup(Table sourceTable, String[] groupColumnNames); List<TableSlice> getSlices(); TableSlice get(int i); Table getSourceTable(); int size(); Table aggregate(String colName1, AggregateFunction<?, ?>... functions); @SuppressWarnings({"unchecked", "rawtypes"}) Table aggregate(ListMultimap<String, AggregateFunction<?, ?>> functions); static Table summaryTableName(Table source); @Override Iterator<TableSlice> iterator(); static String aggregateColumnName(String columnName, String functionName); List<Table> asTableList();  }
@Test public void aggregate() { TableSliceGroup group = StandardTableSliceGroup.create(table, table.categoricalColumn("who")); Table aggregated = group.aggregate("approval", exaggerate); assertEquals(aggregated.rowCount(), group.size()); }
@Test public void testCreateWithTextColumn() { TextColumn whoText = table.stringColumn("who").asTextColumn(); whoText.setName("who text"); table.addColumns(whoText); TableSliceGroup group1 = StandardTableSliceGroup.create(table, table.categoricalColumn("who text")); TableSliceGroup group2 = StandardTableSliceGroup.create(table, table.categoricalColumn("who")); Table aggregated1 = group1.aggregate("approval", exaggerate); Table aggregated2 = group2.aggregate("approval", exaggerate); assertEquals(aggregated1.rowCount(), aggregated2.rowCount()); }