Map<String, String> headers = new HashMap<String, String>(1);
headers.put(RestConstants.HEADER_RESTLI_PROTOCOL_VERSION, version.toString());
ResourceContext context = new ResourceContextImpl(new PathKeysImpl(),
new MockRequest(uri, headers),
new RequestContext());
final MaskTree rootEntityMask = context.getProjectionMask();
Assert.assertEquals(rootEntityMask.toString(), "{d={$*={f=1, e=1}}, b={$*={c=1}}, a={$*=1}}");
final MaskTree metadataMask = context.getMetadataProjectionMask();
Assert.assertEquals(metadataMask.toString(), "{baz={$*={a=1}}, foo={$*={b=1, c=1, a=1}}, bar={$*=1}}");