### Question:
SpringFacesModelHolder extends UIComponentBase { public SpringFacesModel getModel() { return this.model; } SpringFacesModelHolder();  SpringFacesModelHolder(Map<String, ?> model); @Override String getId(); @Override void setId(String id); @Override String getClientId(FacesContext context); @Override String getFamily(); Renderer getRenderer(); @Override boolean isTransient(); @Override void setTransient(boolean transientValue); @Override void restoreState(FacesContext context, Object state); @Override Object saveState(FacesContext context); SpringFacesModel getModel(); static SpringFacesModel attach(FacesContext context, UIViewRoot viewRoot, Map<String, ?> model); static SpringFacesModel getModel(UIViewRoot viewRoot); static final String COMPONENT_ID; }### Answer:
@Test public void shouldSupportNullModel() throws Exception { assertThat(new SpringFacesModelHolder(null).getModel(), is(nullValue())); }
@Test public void shouldCopyModel() throws Exception { Map<String, String> m = Collections.singletonMap("k", "v"); assertThat(new SpringFacesModelHolder(m).getModel().get("k"), is(equalTo((Object) "v"))); }
@Test public void shouldGetModelFromNullViewRoot() throws Exception { assertThat(SpringFacesModelHolder.getModel(null), is(nullValue())); }
@Test public void shouldGetModelFromEmptyViewRoot() throws Exception { UIViewRoot viewRoot = mock(UIViewRoot.class); assertThat(SpringFacesModelHolder.getModel(viewRoot), is(nullValue())); }