code: @SuppressWarnings("unchecked")
    private <T> TypeSerializer<T> getSerializer(Class<T> type) {
      TypeSerializer<T> serializer = (TypeSerializer<T>) serializers.get(type);
      if (serializer == null) {
        TypeSerializerFactory factory = registry.factory(type);
        if (factory != null) {
          serializer = (TypeSerializer<T>) factory.createSerializer(type);
          serializers.put(type, serializer);
        }
      }
      return serializer;
    }
docs: Returns the serializer for the given type else {@code null} if no serializer or factory are registered for the
  {@code type}.