OptionalSerializer implements StreamSerializer<Optional> { public static SerializerConfig createConfig() { SerializerConfig optionalSerializer = new SerializerConfig(); optionalSerializer.setClass(OptionalSerializer.class); optionalSerializer.setTypeClass(Optional.class); return optionalSerializer; }  @Override void write(ObjectDataOutput out, Optional object); @Override Optional read(ObjectDataInput in); @Override int getTypeId(); @Override void destroy(); static SerializerConfig createConfig();  }
@Test public void createConfig() throws Exception { SerializerConfig config = OptionalSerializer.createConfig(); Assert.assertNotNull(config); Assert.assertEquals(Optional.class, config.getTypeClass()); Assert.assertEquals(OptionalSerializer.class.getCanonicalName(), config.getClassName()); }