R resource = _resourceFactory.getMock(resourceClass);
EasyMock.reset(resource);
EasyMock.makeThreadSafe(resource, true);
if (BaseResource.class.isAssignableFrom(resourceClass))
{
BaseResource baseResource = (BaseResource)resource;
baseResource.setContext((ResourceContext)EasyMock.anyObject());
EasyMock.expectLastCall().once();
}
return resource;
}