@Test public void testStateFieldName() { Foo2 stateful = new Foo2(); State<Foo2> stateA = new StateImpl<Foo2>("stateA"); State<Foo2> stateB = new StateImpl<Foo2>("stateB"); List<State<Foo2>> states = new LinkedList<State<Foo2>>(); states.add(stateA); states.add(stateB); MemoryPersisterImpl<Foo2> persister = new MemoryPersisterImpl<Foo2>(stateful, states, stateA, "state"); persister.setCurrent(stateful, stateB); assertEquals(stateB, persister.getCurrent(stateful)); }
protected void setCurrent(T stateful, State<T> current, State<T> next) throws StaleStateException { persister.setCurrent(stateful, current, next); }
FSM { protected void setCurrent(T stateful, State<T> current, State<T> next) throws StaleStateException { persister.setCurrent(stateful, current, next); } }
FSM { protected void setCurrent(T stateful, State<T> current, State<T> next) throws StaleStateException { persister.setCurrent(stateful, current, next); } FSM(String name);  FSM(Persister<T> persister);  FSM(String name, Persister<T> persister);  FSM(String name, Persister<T> persister, int retryAttempts, int retryInterval); }
FSM { protected void setCurrent(T stateful, State<T> current, State<T> next) throws StaleStateException { persister.setCurrent(stateful, current, next); } FSM(String name);  FSM(Persister<T> persister);  FSM(String name, Persister<T> persister);  FSM(String name, Persister<T> persister, int retryAttempts, int retryInterval); State<T> onEvent(T stateful, String event, Object ... args); int getRetryAttempts(); void setRetryAttempts(int retries); int getRetryInterval(); void setRetryInterval(int retryInterval); Persister<T> getPersister(); void setPersister(Persister<T> persister); String getName(); void setName(String name); State<T> getCurrentState(T obj); }
FSM { protected void setCurrent(T stateful, State<T> current, State<T> next) throws StaleStateException { persister.setCurrent(stateful, current, next); } FSM(String name);  FSM(Persister<T> persister);  FSM(String name, Persister<T> persister);  FSM(String name, Persister<T> persister, int retryAttempts, int retryInterval); State<T> onEvent(T stateful, String event, Object ... args); int getRetryAttempts(); void setRetryAttempts(int retries); int getRetryInterval(); void setRetryInterval(int retryInterval); Persister<T> getPersister(); void setPersister(Persister<T> persister); String getName(); void setName(String name); State<T> getCurrentState(T obj);  }