JSONSerializer implements Serializer.SerializerInterface { @Override public ByteBuf encodeHeaders(Map<String, String> applicationHeaders) { return Unpooled.wrappedBuffer(GSON.toJson(applicationHeaders, HEADER_TYPE).getBytes(StandardCharsets.UTF_8)); }  @Override @NotNull String decodeEndpoint(@NotNull ByteBuf arg1); @Override @NotNull Map<String, String> decodeHeaders(@NotNull ByteBuf arg2); @Override T decodeBody(@NotNull ByteBuf arg3, @NotNull Class<T> bodyType); @Override ByteBuf encodeEndpoint(String method); @Override ByteBuf encodeHeaders(Map<String, String> applicationHeaders); @Override ByteBuf encodeBody(Object body);  }
@Test public void testEncodeEmptyHeaders() throws Exception { Map<String, String> emptyHeaders = new HashMap<>(); ByteBuf encodedHeaders = serializer.encodeHeaders(emptyHeaders); assertEquals("{}", encodedHeaders.toString(CharsetUtil.UTF_8)); }