if (FacesContext.getCurrentInstance() != null
&& FacesContext.getCurrentInstance() instanceof MockBaseFacesContext) {
return FacesContext.getCurrentInstance();
} else {
ExternalContext ext = new MockExternalContext20((ServletContext) context, (HttpServletRequest) request,
(HttpServletResponse) response) {
public void setResponseBufferSize(int size) {
((MockHttpServletResponse) getResponse()).setBufferSize(size);
}