static RestRequest createRestRequest(String restMethod, String uri, Account account, Container container)
      throws JSONException, UnsupportedEncodingException, URISyntaxException {
    JSONObject request = new JSONObject();
    request.put(MockRestRequest.REST_METHOD_KEY, (restMethod == null) ? JSONObject.NULL : restMethod);
    request.put(MockRestRequest.URI_KEY, ((uri == null) ? JSONObject.NULL : uri));
    JSONObject headers = new JSONObject();
    headers.putOpt(RestUtils.InternalKeys.TARGET_ACCOUNT_KEY, ((account == null) ? JSONObject.NULL : account));
    headers.putOpt(RestUtils.InternalKeys.TARGET_CONTAINER_KEY, ((container == null) ? JSONObject.NULL : container));
    request.put(MockRestRequest.HEADERS_KEY, headers);
    return new MockRestRequest(request, null);
  }
Method to easily create {@link RestRequest} objects containing a specific request, account and container.
@param restMethod string representation of the rest method.
@param uri string representation of the desired URI.
@param account {@link Account} object associated with the request.
@param container {@link Container} object associated with the request.
@return A {@link RestRequest} object that defines the request required by the input.
@throws JSONException
@throws UnsupportedEncodingException
@throws URISyntaxException
ambry-api/src/test/java/com/github/ambry/rest/RestUtilsTest.java