From 452e8e3fb2bf9a735a7632b8569140b40f7d37a5 Mon Sep 17 00:00:00 2001 From: Carlo Zancanaro Date: Thu, 11 Jun 2015 00:27:26 +1000 Subject: Make the QueueTest Offer command validate its return value --- .../au/id/zancanaro/javacheck/state/queue/commands/Offer.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/test/java/au/id/zancanaro') 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 extends Command, T, Void> { +public class Offer extends Command, T, Boolean> { public final Generator generator; public Offer(Generator argGen) { @@ -26,13 +26,12 @@ public class Offer extends Command, T, Void> { } @Override - public Void runCommand(QueueState state, T args) { - state.getConcreteQueue().offer(args); - return null; + public Boolean runCommand(QueueState state, T args) { + return state.getConcreteQueue().offer(args); } @Override - public QueueState nextState(QueueState state, T args, CommandValue result) { + public QueueState nextState(QueueState state, T args, CommandValue result) { List newState = new ArrayList<>(state.getAbstractQueue()); newState.add(args); return state.withAbstractQueue(newState); -- cgit v1.2.3