code: public static Map<String, String> populateRequestProperties(
              Map<String, String> requestProperties, int bodyLength, MediaType contentType, MediaType acceptType) {
          Map<String, String> properties;
          // requestProperties
          if (requestProperties == null || requestProperties.isEmpty()) {
              properties = new HashMap<>();
          } else {
              properties = new HashMap<>(requestProperties);
          }
          if (acceptType != null) {
              properties.put(HeaderNames.ACCEPT, acceptType.toString());
          }
          if (contentType != null) {
              properties.put(HeaderNames.CONTENT_TYPE, contentType.toString());
          }
          if (bodyLength > -1) {
              properties.put(HeaderNames.CONTENT_LENGTH, String.valueOf(bodyLength));
          }
          return properties;
      }
docs: Util method for first populating request properties before execution.
  
  @param requestProperties request properties, may be immutable.
  It can be null or empty, so copying will take place, if necessary.
  @param bodyLength        body length
  @param contentType       content type
  @param acceptType        access type
  @return populated request properties