@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 testSerializableHeadersWithListValue() {
    Map<String, Object> rawHeaders = new HashMap<>();
    List<String> expectedSerializedList = Lists.newArrayList("value1", "value2");
    List<LongString> rawList =
        expectedSerializedList.stream()
            .map(LongStringHelper::asLongString)
            .collect(Collectors.toList());
    String key1 = "key1";
    rawHeaders.put(key1, rawList);

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

    assertEquals(expectedSerializedList, serializedHeaders.get(key1));
  }