From 8376ed30f83c9193025da5962de5f5d78edfa185 Mon Sep 17 00:00:00 2001 From: Carlo Zancanaro Date: Tue, 24 Nov 2015 12:57:27 +1100 Subject: Add an implicit generator for Sets --- .../au/id/zancanaro/javacheck/CollectionsTest.java | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/test/java/au/id/zancanaro/javacheck/CollectionsTest.java (limited to 'src/test/java/au/id/zancanaro/javacheck/CollectionsTest.java') diff --git a/src/test/java/au/id/zancanaro/javacheck/CollectionsTest.java b/src/test/java/au/id/zancanaro/javacheck/CollectionsTest.java new file mode 100644 index 0000000..644e8a1 --- /dev/null +++ b/src/test/java/au/id/zancanaro/javacheck/CollectionsTest.java @@ -0,0 +1,23 @@ +package au.id.zancanaro.javacheck; + +import au.id.zancanaro.javacheck.annotations.Property; +import au.id.zancanaro.javacheck.junit.Properties; +import org.junit.runner.RunWith; + +import java.util.ArrayList; +import java.util.List; + +import static java.util.Collections.reverse; +import static org.junit.Assert.assertEquals; + +@RunWith(Properties.class) +public class CollectionsTest { + @Property + public void reverseIsInvolution(List list) { + List newList = new ArrayList<>(list); + reverse(newList); + reverse(newList); + + assertEquals(list, newList); + } +} -- cgit v1.2.3