@SuppressWarnings("unchecked") @Test public void testAlternateStateFields() { List<State<MockEntity>> states = new ArrayList<State<MockEntity>>(); State<MockEntity> startState = mock(State.class); states.add(startState); MockPersister<MockEntity> mockPersister = new MockPersister<MockEntity>( states, "stateField1", startState, MockEntity.class); Field field = mockPersister.getStateField(); assertNotNull(field); assertEquals("stateField1", field.getName()); mockPersister = new MockPersister<MockEntity>( states, "", startState, MockEntity.class); field = mockPersister.getStateField(); assertNotNull(field); assertEquals("stateField2", field.getName()); }
public Field getStateField() { return this.stateFieldAccessor.getField(); }
AbstractPersister implements Persister<T> { public Field getStateField() { return this.stateFieldAccessor.getField(); } }
AbstractPersister implements Persister<T> { public Field getStateField() { return this.stateFieldAccessor.getField(); } AbstractPersister(
			List<State<T>> states,
			String stateFieldName,
			State<T> startState,
			Class<T> clazz); }
AbstractPersister implements Persister<T> { public Field getStateField() { return this.stateFieldAccessor.getField(); } AbstractPersister(
			List<State<T>> states,
			String stateFieldName,
			State<T> startState,
			Class<T> clazz); @Override State<T> getCurrent(T stateful); @Override abstract void setCurrent(T stateful, State<T> current, State<T> next); @Override void setStates(Collection<State<T>> states); @Override void setStartState(State<T> startState); Field getIdField(); Field getStateField(); }
AbstractPersister implements Persister<T> { public Field getStateField() { return this.stateFieldAccessor.getField(); } AbstractPersister(
			List<State<T>> states,
			String stateFieldName,
			State<T> startState,
			Class<T> clazz); @Override State<T> getCurrent(T stateful); @Override abstract void setCurrent(T stateful, State<T> current, State<T> next); @Override void setStates(Collection<State<T>> states); @Override void setStartState(State<T> startState); Field getIdField(); Field getStateField();  }