@Override
  public boolean isReturnEntityRequested()
  {
    String returnEntityValue = getParameter(RestConstants.RETURN_ENTITY_PARAM);
    if (returnEntityValue == null)
    {
      // Default to true for backward compatibility so that existing clients can receive entity without using parameter
      return true;
    }
    return ArgumentUtils.parseReturnEntityParameter(returnEntityValue);
  }
@Test(dataProvider = "returnEntityParameterData")
  public void testReturnEntityParameter(String uri, boolean expectReturnEntity, boolean expectException) throws RestLiSyntaxException
  {
    final ResourceContextImpl context = new ResourceContextImpl(new PathKeysImpl(),
        new RestRequestBuilder(URI.create(uri))
            .setHeader(RestConstants.HEADER_RESTLI_PROTOCOL_VERSION, AllProtocolVersions.LATEST_PROTOCOL_VERSION.toString())
            .build(),
        new RequestContext());

    try
    {
      final boolean returnEntity = context.isReturnEntityRequested();

      if (expectException)
      {
        Assert.fail("Exception should be thrown for URI: " + uri);
      }
      Assert.assertEquals(returnEntity, expectReturnEntity, "Resource context was wrong about whether the URI \"" + uri + "\" indicates that the entity should be returned.");
    }
    catch (RestLiServiceException e)
    {
      if (!expectException)
      {
        Assert.fail("Exception should not be thrown for URI: " + uri);
      }
    }
  }