@Test
    public void testAggregatorResults() throws IOException {
        try (SerializationTester t = new SerializationTester("testAggregatorResults")) {
            t.assertMatch(new SumAggregationResult(new IntegerResultNode(7))
                    .setExpression(new AttributeNode("attributeA")));
            t.assertMatch(new XorAggregationResult()
                    .setXor(7)
                    .setExpression(new AttributeNode("attributeA")));
            t.assertMatch(new CountAggregationResult()
                    .setCount(7)
                    .setExpression(new AttributeNode("attributeA")));
            t.assertMatch(new MinAggregationResult(new IntegerResultNode(7))
                    .setExpression(new AttributeNode("attributeA")));
            t.assertMatch(new MaxAggregationResult(new IntegerResultNode(7))
                    .setExpression(new AttributeNode("attributeA")));
            t.assertMatch(new AverageAggregationResult(new IntegerResultNode(7), 0)
                    .setExpression(new AttributeNode("attributeA")));
            SparseSketch sketch = new SparseSketch();
            sketch.aggregate(1955583074);
            t.assertMatch(new ExpressionCountAggregationResult(sketch, s -> 42)
                    .setExpression(new ConstantNode(new IntegerResultNode(67))));
            t.assertMatch(new StandardDeviationAggregationResult(1, 67, 67 * 67)
                    .setExpression(new ConstantNode(new IntegerResultNode(67))));
        }
    }
Tests serialization compatibility across Java and C++. The comparison is performed by comparing serialized Java
object graphs with the content of specific binary files. C++ unit tests serializes
identical data structures into these files.
Note: This test relies heavily on proper implementation of {@link Object#equals(Object)}!
searchlib/src/test/java/com/yahoo/searchlib/aggregation/GroupingSerializationTest.java