package au.id.zancanaro.javacheck.state; import au.id.zancanaro.javacheck.Generator; public abstract class Command { public Generator argsGenerator(S state) { return Generator.pure(null); } public boolean preCondition(S state, A args) { return true; } public abstract R runCommand(S state, A args) throws Throwable; public S nextState(S state, A args, CommandValue result) { return state; } public void postCondition(S oldState, S newState, A args, R result) throws Throwable { } @Override public String toString() { return this.getClass().getSimpleName(); } }