CountAggregator extends Aggregator<CountState> { @Override public String toString() { return String.format(Locale.ROOT, "count(%s)", format(getArguments())); } CountAggregator(List<Expression> arguments, ExprCoreType returnType); @Override CountAggregator.CountState create(); @Override CountState iterate(BindingTuple tuple, CountState state); @Override String toString();  }
@Test public void test_to_string() { Aggregator countAggregator = dsl.count(DSL.ref("integer_value", INTEGER)); assertEquals("count(integer_value)", countAggregator.toString()); }
@Test public void test_nested_to_string() { Aggregator countAggregator = dsl.count(dsl.abs(DSL.ref("integer_value", INTEGER))); assertEquals(String.format("count(abs(%s))", DSL.ref("integer_value", INTEGER)), countAggregator.toString()); }