package au.id.zancanaro.javacheck.state.queue.commands; import au.id.zancanaro.javacheck.state.Command; import au.id.zancanaro.javacheck.state.CommandValue; import au.id.zancanaro.javacheck.state.queue.MyQueue; import au.id.zancanaro.javacheck.state.queue.QueueState; import java.util.ArrayList; import java.util.Queue; public class New extends Command, Void, Queue> { @Override public boolean preCondition(QueueState state, Void args) { return state == null; } @Override public Queue runCommand(QueueState state, Void args) { return new MyQueue<>(); } @Override public QueueState nextState(QueueState state, Void args, CommandValue> result) { return new QueueState<>(result, new ArrayList<>()); } }