private void setAccountAndContainerHeaders(JSONObject headers, String targetAccountName, String targetContainerName)
      throws JSONException {
    if (headers != null) {
      if (targetAccountName != null) {
        headers.put(RestUtils.Headers.TARGET_ACCOUNT_NAME, targetAccountName);
      }
      if (targetContainerName != null) {
        headers.put(RestUtils.Headers.TARGET_CONTAINER_NAME, targetContainerName);
      }
    } else {
      throw new IllegalArgumentException("Some required arguments are null. Cannot set ambry headers");
    }
  }
Sets account name and container name in headers.
@param headers the {@link JSONObject} where the headers should be set.
@param targetAccountName sets the {@link RestUtils.Headers#TARGET_ACCOUNT_NAME} header. Can be {@code null}.
@param targetContainerName sets the {@link RestUtils.Headers#TARGET_CONTAINER_NAME} header. Can be {@code null}.
@throws IllegalArgumentException if {@code headers} is null.
@throws JSONException
ambry-frontend/src/test/java/com/github/ambry/frontend/FrontendRestRequestServiceTest.java