@Test
public void testSerializeSkipFieldNotInVersion() throws B2JsonException {

    // Version 3 is too soon
    {
        final B2JsonOptions options = B2JsonOptions.builder().setVersion(3).build();
        assertEquals(
                "{}",
                b2Json.toJson(new VersionedContainer(3, 5), options)
        );
    }
    // Version 4 is the first version where it's present
    {
        final B2JsonOptions options = B2JsonOptions.builder().setVersion(4).build();
        assertEquals(
                "{\n  \"x\": 3\n}",
                b2Json.toJson(new VersionedContainer(3, 5), options)
        );
    }
    // Version 6 is the last version where it's present
    {
        final B2JsonOptions options = B2JsonOptions.builder().setVersion(4).build();
        assertEquals(
                "{\n  \"x\": 3\n}",
                b2Json.toJson(new VersionedContainer(3, 5), options)
        );
    }
    // Version 7 is too late.
    {
        final B2JsonOptions options = B2JsonOptions.builder().setVersion(7).build();
        assertEquals(
                "{}",
                b2Json.toJson(new VersionedContainer(3, 5), options)
        );
    }
}