@Test
    public void testResultTypes() throws IOException {
        try (SerializationTester t = new SerializationTester("testResultTypes")) {
            t.assertMatch(new IntegerResultNode(7));
            t.assertMatch(new FloatResultNode(7.3));
            t.assertMatch(new StringResultNode("7.3"));
            t.assertMatch(new StringResultNode(
                    new String(new byte[]{(byte)0xe5, (byte)0xa6, (byte)0x82, (byte)0xe6, (byte)0x9e, (byte)0x9c},
                               StandardCharsets.UTF_8)));
            t.assertMatch(new RawResultNode(new byte[]{'7', '.', '4'}));
            t.assertMatch(new IntegerBucketResultNode());
            t.assertMatch(new FloatBucketResultNode());
            t.assertMatch(new IntegerBucketResultNode(10, 20));
            t.assertMatch(new FloatBucketResultNode(10, 20));
            t.assertMatch(new StringBucketResultNode("10.0", "20.0"));
            t.assertMatch(new RawBucketResultNode(
                    new RawResultNode(new byte[]{1, 0, 0}),
                    new RawResultNode(new byte[]{1, 1, 0})));
            t.assertMatch(new IntegerBucketResultNodeVector()
                    .add(new IntegerBucketResultNode(878, 3246823)));
            t.assertMatch(new FloatBucketResultNodeVector()
                    .add(new FloatBucketResultNode(878, 3246823)));
            t.assertMatch(new StringBucketResultNodeVector()
                    .add(new StringBucketResultNode("878", "3246823")));
            t.assertMatch(new RawBucketResultNodeVector()
                    .add(new RawBucketResultNode(
                            new RawResultNode(new byte[]{1, 0, 0}),
                            new RawResultNode(new byte[]{1, 1, 0}))));
        }

    }
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