code: private static Header[] removeHeaders(Header[] headersToClean, String[] headersToRemove) {
          ArrayList<Header> headers = new ArrayList<>();
          if (headersToClean == null) {
              return null;
          }
          for (Header header : headersToClean) {
              if (!StringUtils.equalsAnyIgnoreCase(header.getName(), headersToRemove)) {
                  headers.add(header);
              }
          }
          LOG.debug("Removed the content-length and content-type headers as the HTTP Client lib will care "
              + "about them as soon as the entity is set on the POST object.");
          Header[] headersArray = new Header[headers.size()];
          headersArray = headers.toArray(headersArray);
          return headersArray;
      }
docs: Remove headers form header array that match Strings in headersToRemove
  
  @param headersToClean  Array of {@link Header}: Headers to clean up
  @param headersToRemove Header names to remove