code: private HttpPost createHttpPostEntity(ReviewInput reviewInput, String reviewEndpoint) {
          HttpPost httpPost = new HttpPost(reviewEndpoint);
  
          String asJson = GSON.toJson(reviewInput);
  
          StringEntity entity = null;
          try {
              entity = new StringEntity(asJson);
          } catch (UnsupportedEncodingException e) {
              logger.error("Failed to create JSON for posting to Gerrit", e);
              if (altLogger != null) {
                  altLogger.print("ERROR Failed to create JSON for posting to Gerrit: " + e.toString());
              }
              return null;
          }
          entity.setContentType("application/json");
          httpPost.setEntity(entity);
          return httpPost;
      }
docs: Construct the post.
  
  @param reviewInput    input
  @param reviewEndpoint end point
  @return the entity