code: public static <K, V> JsonQueue<Map<K, V>> createMapQueueWithMapper(
              final Class<K> mapKeyClass,
              final Class<V> valueKeyClass,
              final Queue<String> queue,
              final JsonMapper jsonMapper) {
  
          return new JsonQueue<>(queue,
                  json -> jsonMapper.fromJsonMap(json, mapKeyClass, valueKeyClass),
                  jsonMapper::toJson);
      }
docs: Create a  JsonQueue that can send a Map of values
  
  @param mapKeyClass   mapKey class
  @param valueKeyClass valueKey class
  @param queue         queue
  @param jsonMapper    jsonMapper
  @param <K>           K
  @param <V>           V
  @return new JsonQueue that works with maps.