### Question:
FacesPropertyAccessor extends ELPropertyAccessor { @Override protected ELContext getElContext(EvaluationContext context, Object target) { if (FacesContext.getCurrentInstance() != null) { return FacesContext.getCurrentInstance().getELContext(); } return null; }    }### Answer:
@Test public void shouldWorkWithoutFacesContext() throws Exception { assertThat(this.facesPropertyAccessor.getElContext(this.context, this.target), is(nullValue())); }
@Test public void shouldGetElContextFromFacesContext() throws Exception { FacesContext facesContext = mock(FacesContext.class); FacesContextSetter.setCurrentInstance(facesContext); ELContext elContext = mock(ELContext.class); given(facesContext.getELContext()).willReturn(elContext); assertThat(this.facesPropertyAccessor.getElContext(this.context, elContext), is(sameInstance(elContext))); }