SerialBinding binding = new SerialBinding(catalog, cls);
binding.objectToEntry(val, buffer);
assertTrue(buffer.getSize() > 0);
Object val2 = binding.entryToObject(buffer);
assertSame(cls, val2.getClass());
assertEquals(val, val2);
Object valWithWrongCls = (cls == String.class)
? ((Object) new Integer(0)) : ((Object) new String(""));