code: public static ObjectMapper newObjectMapper(SimpleModule... userModules) {
          final ObjectMapper objectMapper = new ObjectMapper();
  
          final SimpleModule module = new SimpleModule();
          module.addSerializer(TMessage.class, new TMessageSerializer());
          module.addSerializer(TBase.class, new TBaseSerializer());
          module.addSerializer(TApplicationException.class, new TApplicationExceptionSerializer());
          module.addSerializer(ThriftCall.class, new ThriftCallSerializer());
          module.addSerializer(ThriftReply.class, new ThriftReplySerializer());
          objectMapper.registerModule(module);
  
          for (SimpleModule userModule : userModules) {
              objectMapper.registerModule(userModule);
          }
  
          return objectMapper;
      }
docs: Returns newly created {@link ObjectMapper} which is configured properly to serialize some knows classes
  in a good way.