test serialization of anonymous class