Source:
<code>public static String sendPostRequest(String backendURL, String message, Map<String, String> requestProps) { OutputStream outputStream = null; InputStream inputStream = null; BufferedReader reader = null; String response = null; URL url = null; try { url = new URL(backendURL); httpsURLConnection = (HttpsURLConnection) url.openConnection(); httpsURLConnection.setSSLSocketFactory(sslSocketFactory); httpsURLConnection.setDoOutput(true); httpsURLConnection.setDoInput(true); httpsURLConnection.setRequestMethod(HTTP_POST); if (requestProps != null && !requestProps.isEmpty()) { <START> for (Map.Entry<String, String> entry : requestProps.entrySet()) { <END> httpsURLConnection.setRequestProperty(entry.getKey(), entry.getValue()); } } outputStream = httpsURLConnection.getOutputStream(); if (StringUtils.isNotEmpty(message)) { outputStream.write(message.getBytes(Charset.forName("UTF-8"))); } inputStream = httpsURLConnection.getInputStream(); reader = new BufferedReader(new InputStreamReader(inputStream, Charset.forName("UTF-8"))); StringBuilder builder = new StringBuilder(); String line; while (StringUtils.isNotEmpty(line = reader.readLine())) { builder.append(line); } response = builder.toString(); } catch (IOException e) { log.error("Sending " + HTTP_POST + " request to URL : " + url + "failed.", e); } finally { try { if (reader != null) { reader.close(); } if (inputStream != null) { inputStream.close(); } if (outputStream != null) { outputStream.close(); } } catch (IOException e) { log.error("Closing stream for " + url + " failed", e); } } return response; }</code><technical_language>requestProps != null is enough.... isEmpty check is redundant</technical_language>

Target:
public static String sendPostRequest(String backendURL, String message, Map<String, String> requestProps) { OutputStream outputStream = null; InputStream inputStream = null; BufferedReader reader = null; String response = null; URL url = null; try { url = new URL(backendURL); httpsURLConnection = (HttpsURLConnection) url.openConnection(); httpsURLConnection.setSSLSocketFactory(sslSocketFactory); httpsURLConnection.setDoOutput(true); httpsURLConnection.setDoInput(true); httpsURLConnection.setRequestMethod(HTTP_POST); if (requestProps != null) { for (Map.Entry<String, String> entry : requestProps.entrySet()) { httpsURLConnection.setRequestProperty(entry.getKey(), entry.getValue()); } } outputStream = httpsURLConnection.getOutputStream(); if (StringUtils.isNotEmpty(message)) { outputStream.write(message.getBytes(StandardCharsets.UTF_8)); } inputStream = httpsURLConnection.getInputStream(); reader = new BufferedReader(new InputStreamReader(inputStream, StandardCharsets.UTF_8)); StringBuilder builder = new StringBuilder(); String line; while (StringUtils.isNotEmpty(line = reader.readLine())) { builder.append(line); } response = builder.toString(); } catch (IOException e) { log.error("Sending " + HTTP_POST + " request to URL : " + url + "failed.", e); } finally { try { if (reader != null) { reader.close(); } if (inputStream != null) { inputStream.close(); } if (outputStream != null) { outputStream.close(); } } catch (IOException e) { log.error("Closing stream for " + url + " failed", e); } } return response; }