public int add(Object o) {
        HollowTypeMapper typeMapper = getTypeMapper(o.getClass(), null, null);
        return typeMapper.write(o);
    }
@Test
    public void testAllFieldTypes() throws IOException {
        HollowObjectMapper mapper = new HollowObjectMapper(writeStateEngine);

        mapper.add(new TypeWithAllFieldTypes(1));
        mapper.add(new TypeWithAllFieldTypes(2));

        TypeWithAllFieldTypes t = new TypeWithAllFieldTypes(3);
        t.nullFirstHalf();
        mapper.add(t);

        t = new TypeWithAllFieldTypes(4);
        t.nullSecondHalf();
        mapper.add(t);

        roundTripSnapshot();

        TypeWithAllFieldTypes expected = new TypeWithAllFieldTypes(1);
        TypeWithAllFieldTypes actual = new TypeWithAllFieldTypes(new GenericHollowObject(readStateEngine, "TypeWithAllFieldTypes", 0));
        Assert.assertEquals(expected, actual);

        expected = new TypeWithAllFieldTypes(2);
        actual = new TypeWithAllFieldTypes(new GenericHollowObject(readStateEngine, "TypeWithAllFieldTypes", 1));
        Assert.assertEquals(expected, actual);

        expected = new TypeWithAllFieldTypes(3);
        expected.nullFirstHalf();
        actual = new TypeWithAllFieldTypes(new GenericHollowObject(readStateEngine, "TypeWithAllFieldTypes", 2));
        Assert.assertEquals(expected, actual);

        expected = new TypeWithAllFieldTypes(4);
        expected.nullSecondHalf();
        actual = new TypeWithAllFieldTypes(new GenericHollowObject(readStateEngine, "TypeWithAllFieldTypes", 3));
        Assert.assertEquals(expected, actual);
    }