public static ByteString dataMapToByteString(Map<String, String> headers, DataMap dataMap) throws MimeTypeParseException, IOException
  {
    return ByteString.unsafeWrap(getContentType(headers).getCodec().mapToBytes(dataMap));
  }
@Test
  public void testDataMapToJSONByteStringWithUnsupportedContentType() throws MimeTypeParseException, IOException
  {
    // unsupport content type should fallback to JSON
    DataMap testDataMap = createTestDataMap();
    byte[] expectedBytes = JACKSON_DATA_CODEC.mapToBytes(testDataMap);

    Map<String, String> headers = Collections.singletonMap(RestConstants.HEADER_CONTENT_TYPE, "mysuperkool/xson");
    ByteString byteString = DataMapConverter.dataMapToByteString(headers, testDataMap);
    Assert.assertEquals(byteString.copyBytes(), expectedBytes);
  }