code: private String convertToJson(Map<String, ?> map) throws MovieDbException {
          try {
              return MAPPER.writeValueAsString(map);
          } catch (JsonProcessingException ex) {
              throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "JSON conversion failed", "", ex);
          }
      }
docs: Use Jackson to convert Map to JSON string.
  
  @param map Map to convert to json
  @return json string
  @throws MovieDbException exception