diff options
author | Carlo Zancanaro <carlo@zancanaro.id.au> | 2015-06-11 00:27:26 +1000 |
---|---|---|
committer | Carlo Zancanaro <carlo@zancanaro.id.au> | 2015-06-11 00:27:26 +1000 |
commit | 452e8e3fb2bf9a735a7632b8569140b40f7d37a5 (patch) | |
tree | 8c6a0cbffd97c5e92eb23a30b0ba27fe3fb5dcf4 | |
parent | b2055f2a1dd2117cdd05ab6596c38c82d3d05240 (diff) |
Make the QueueTest Offer command validate its return value
-rw-r--r-- | src/test/java/au/id/zancanaro/javacheck/state/queue/commands/Offer.java | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/test/java/au/id/zancanaro/javacheck/state/queue/commands/Offer.java b/src/test/java/au/id/zancanaro/javacheck/state/queue/commands/Offer.java index 366e974..3f21547 100644 --- a/src/test/java/au/id/zancanaro/javacheck/state/queue/commands/Offer.java +++ b/src/test/java/au/id/zancanaro/javacheck/state/queue/commands/Offer.java @@ -8,7 +8,7 @@ import au.id.zancanaro.javacheck.state.queue.QueueState; import java.util.ArrayList; import java.util.List; -public class Offer<T> extends Command<QueueState<T>, T, Void> { +public class Offer<T> extends Command<QueueState<T>, T, Boolean> { public final Generator<T> generator; public Offer(Generator<T> argGen) { @@ -26,13 +26,12 @@ public class Offer<T> extends Command<QueueState<T>, T, Void> { } @Override - public Void runCommand(QueueState<T> state, T args) { - state.getConcreteQueue().offer(args); - return null; + public Boolean runCommand(QueueState<T> state, T args) { + return state.getConcreteQueue().offer(args); } @Override - public QueueState<T> nextState(QueueState<T> state, T args, CommandValue<Void> result) { + public QueueState<T> nextState(QueueState<T> state, T args, CommandValue<Boolean> result) { List<T> newState = new ArrayList<>(state.getAbstractQueue()); newState.add(args); return state.withAbstractQueue(newState); |