@Test
    public void testFunctionNodes() throws IOException {
        try (SerializationTester t = new SerializationTester("testFunctionNodes")) {
            t.assertMatch(new AddFunctionNode()
                    .addArg(new ConstantNode(new IntegerResultNode(7)))
                    .addArg(new ConstantNode(new IntegerResultNode(8)))
                    .addArg(new ConstantNode(new IntegerResultNode(9))));
            t.assertMatch(new XorFunctionNode()
                    .addArg(new ConstantNode(new IntegerResultNode(7)))
                    .addArg(new ConstantNode(new IntegerResultNode(8)))
                    .addArg(new ConstantNode(new IntegerResultNode(9))));
            t.assertMatch(new MultiplyFunctionNode()
                    .addArg(new ConstantNode(new IntegerResultNode(7)))
                    .addArg(new ConstantNode(new IntegerResultNode(8)))
                    .addArg(new ConstantNode(new IntegerResultNode(9))));
            t.assertMatch(new DivideFunctionNode()
                    .addArg(new ConstantNode(new IntegerResultNode(7)))
                    .addArg(new ConstantNode(new IntegerResultNode(8)))
                    .addArg(new ConstantNode(new IntegerResultNode(9))));
            t.assertMatch(new ModuloFunctionNode()
                    .addArg(new ConstantNode(new IntegerResultNode(7)))
                    .addArg(new ConstantNode(new IntegerResultNode(8)))
                    .addArg(new ConstantNode(new IntegerResultNode(9))));
            t.assertMatch(new MinFunctionNode()
                    .addArg(new ConstantNode(new IntegerResultNode(7)))
                    .addArg(new ConstantNode(new IntegerResultNode(8)))
                    .addArg(new ConstantNode(new IntegerResultNode(9))));
            t.assertMatch(new MaxFunctionNode()
                    .addArg(new ConstantNode(new IntegerResultNode(7)))
                    .addArg(new ConstantNode(new IntegerResultNode(8)))
                    .addArg(new ConstantNode(new IntegerResultNode(9))));
            t.assertMatch(new TimeStampFunctionNode(new ConstantNode(new IntegerResultNode(7)),
                    TimeStampFunctionNode.TimePart.Hour, true));
            t.assertMatch(new ZCurveFunctionNode(new ConstantNode(new IntegerResultNode(7)),
                    ZCurveFunctionNode.Dimension.X));
            t.assertMatch(new ZCurveFunctionNode(new ConstantNode(new IntegerResultNode(7)),
                    ZCurveFunctionNode.Dimension.Y));
            t.assertMatch(new NegateFunctionNode(new ConstantNode(new IntegerResultNode(7))));
            t.assertMatch(new SortFunctionNode(new ConstantNode(new IntegerResultNode(7))));
            t.assertMatch(new NormalizeSubjectFunctionNode(new ConstantNode(
                    new StringResultNode("foo"))));
            t.assertMatch(new ReverseFunctionNode(new ConstantNode(new IntegerResultNode(7))));
            t.assertMatch(new MD5BitFunctionNode(new ConstantNode(new IntegerResultNode(7)), 64));
            t.assertMatch(new XorBitFunctionNode(new ConstantNode(new IntegerResultNode(7)), 64));
            t.assertMatch(new CatFunctionNode()
                    .addArg(new ConstantNode(new IntegerResultNode(7)))
                    .addArg(new ConstantNode(new IntegerResultNode(8)))
                    .addArg(new ConstantNode(new IntegerResultNode(9))));
            t.assertMatch(new FixedWidthBucketFunctionNode());
            t.assertMatch(new FixedWidthBucketFunctionNode().addArg(new AttributeNode("foo")));
            t.assertMatch(new FixedWidthBucketFunctionNode(new IntegerResultNode(10), new AttributeNode("foo")));
            t.assertMatch(new FixedWidthBucketFunctionNode(new FloatResultNode(10.0), new AttributeNode("foo")));
            t.assertMatch(new RangeBucketPreDefFunctionNode());
            t.assertMatch(new RangeBucketPreDefFunctionNode().addArg(new AttributeNode("foo")));
            t.assertMatch(new DebugWaitFunctionNode(new ConstantNode(new IntegerResultNode(5)),
                    3.3, false));
        }

    }
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