@Test
public void testComputeColumnAggregations() {
String columnName = "col";
int value = 5;
TableAnswerElement table =
new TableAnswerElement(
new TableMetadata(
ImmutableList.of(new ColumnMetadata(columnName, Schema.INTEGER, "foobar")),
new DisplayHints().getTextDesc()))
.addRow(Row.of(columnName, value));
List<ColumnAggregation> aggregations =
ImmutableList.of(new ColumnAggregation(Aggregation.MAX, columnName));
assertThat(
AnswerMetadataUtil.computeColumnAggregations(table, aggregations, _logger),
equalTo(ImmutableMap.of(columnName, ImmutableMap.of(Aggregation.MAX, value))));
}