### Question:
SpringBeanPartialStateHolder implements PartialStateHolder { protected final T getBean() { return this.bean; } @Deprecated  SpringBeanPartialStateHolder();  SpringBeanPartialStateHolder(FacesContext context, String beanName); Object saveState(FacesContext context); void restoreState(FacesContext context, Object state); boolean isTransient(); void setTransient(boolean newTransientValue); void markInitialState(); boolean initialStateMarked(); void clearInitialState();  }### Answer:
@Test public void shouldObtainBeanOnConstruct() throws Exception { SpringBeanPartialStateHolder<Object> holder = new SpringBeanPartialStateHolder<Object>(this.context, this.beanName); assertThat(holder.getBean(), is(this.bean)); }
@Test public void shouldOnlySupportStateHolderBeansIfPrototype() throws Exception { reset(this.applicationContext); given(this.applicationContext.getBean(this.stateHolderBeanName)).willReturn(this.stateHolderBean); this.thrown.expect(IllegalStateException.class); this.thrown.expectMessage("StateHolders must be declared as protoype beans"); new SpringBeanPartialStateHolder<Object>(this.context, this.stateHolderBeanName); }