summaryrefslogtreecommitdiff
path: root/src/test/java/au/id/zancanaro/javacheck/CollectionsTest.java
blob: 644e8a139179ec0aa93470970289a43de56e7eed (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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<Integer> list) {
        List<Integer> newList = new ArrayList<>(list);
        reverse(newList);
        reverse(newList);

        assertEquals(list, newList);
    }
}