@VisibleForTesting
  static Map<String, Object> serializableHeaders(Map<String, Object> headers) {
    Map<String, Object> returned = new HashMap<>();
    if (headers != null) {
      for (Map.Entry<String, Object> h : headers.entrySet()) {
        Object value = h.getValue();
        if (value instanceof List<?>) {
          // Transformation for List type headers
          value =
              ((List<?>) value)
                  .stream().map(RabbitMqMessage::getTransformedValue).collect(Collectors.toList());
        } else if (!(value instanceof Serializable)) {
          value = getTransformedValue(value);
        }
        returned.put(h.getKey(), value);
      }
    }
    return returned;
  }
@Test
  public void testSerializableHeadersWithLongStringValues() {
    Map<String, Object> rawHeaders = new HashMap<>();
    String key1 = "key1", key2 = "key2", value1 = "value1", value2 = "value2";
    rawHeaders.put(key1, LongStringHelper.asLongString(value1));
    rawHeaders.put(key2, LongStringHelper.asLongString(value2.getBytes(StandardCharsets.UTF_8)));

    Map<String, Object> serializedHeaders = RabbitMqMessage.serializableHeaders(rawHeaders);

    assertEquals(value1, serializedHeaders.get(key1));
    assertEquals(value2, serializedHeaders.get(key2));
  }