12
12
import static com .nitorcreations .predicates .PredicateAssert .assertThat ;
13
13
import static java .util .Arrays .asList ;
14
14
import static java .util .Collections .emptyList ;
15
+ import static java .util .Collections .singletonList ;
15
16
16
17
public class NCollectionPredicatesTest {
17
18
@@ -24,55 +25,61 @@ public void forCoverage() throws InvocationTargetException, NoSuchMethodExceptio
24
25
public void testEmpty () {
25
26
assertThat (empty ())
26
27
.matchesAll (new HashSet <>(), new ArrayList <>())
27
- .matchesNone (null , asList (1 ), asSet (1 ));
28
+ .matchesNone (null , singletonList (1 ), asSet (1 ));
28
29
}
29
30
30
31
@ Test
31
32
public void testNotEmpty () {
32
33
assertThat (notEmpty ())
33
- .matchesAll (asList (1 ), asSet (1 ))
34
+ .matchesAll (singletonList (1 ), asSet (1 ))
34
35
.matchesNone (null , new HashSet <>(), new ArrayList <>());
35
36
}
36
37
37
38
@ Test
38
39
public void testContains () {
39
- final Long num = 666_666l ;
40
+ final Long num = 666_666L ;
40
41
assertThat (contains (num ))
41
- .matchesAll (asList (1l , num ), asSet (num ), asList ( 666_666l ))
42
- .matchesNone (null , emptyList (), asList ( 113l ));
42
+ .matchesAll (asList (1L , num ), asSet (num ), singletonList ( 666_666L ))
43
+ .matchesNone (null , emptyList (), singletonList ( 113L ));
43
44
}
44
45
45
46
@ Test
46
47
public void testContainsAll () {
47
- final Long n1 = 123_123l ;
48
- final Long n2 = 321_321l ;
48
+ final Long n1 = 123_123L ;
49
+ final Long n2 = 321_321L ;
49
50
assertThat (containsAll (n1 , n2 ))
50
51
.matchesAll (asList (n1 , n2 ), asList (n2 , n1 ), asSet (n1 , n2 ))
51
- .matchesNone (null , emptyList (), asList ( 113l ));
52
+ .matchesNone (null , emptyList (), singletonList ( 113L ));
52
53
}
53
54
54
55
@ Test
55
56
public void testContainsAny () {
56
- final Long n1 = 123_123l ;
57
- final Long n2 = 321_321l ;
57
+ final Long n1 = 123_123L ;
58
+ final Long n2 = 321_321L ;
58
59
assertThat (containsAny (n1 , n2 ))
59
- .matchesAll (asList (n1 ), asList (n2 ), asList (n1 , n2 ), asList (n2 , n1 ), asSet (n1 , n2 ))
60
- .matchesNone (null , emptyList (), asList ( 113l ));
60
+ .matchesAll (singletonList (n1 ), singletonList (n2 ), asList (n1 , n2 ), asList (n2 , n1 ), asSet (n1 , n2 ))
61
+ .matchesNone (null , emptyList (), singletonList ( 113L ));
61
62
}
62
63
63
64
@ Test
64
65
public void testDoesNotContain () {
65
- final Long num = 666_666l ;
66
+ final Long num = 666_666L ;
66
67
assertThat (doesNotContain (num ))
67
- .matchesAll (emptyList (), asList ( 113l ))
68
- .matchesNone (null , asList (1l , num ), asSet (num ), asList ( 666_666l ));
68
+ .matchesAll (emptyList (), singletonList ( 113L ))
69
+ .matchesNone (null , asList (1L , num ), asSet (num ), singletonList ( 666_666L ));
69
70
}
70
71
71
72
@ Test
72
73
public void testDoesNotContainAnyOf () {
73
- assertThat (doesNotContainAnyOf (123l , 321l ))
74
- .matchesAll (emptyList (), asList ( 113l ))
75
- .matchesNone (null , asList (1l , 123l ), asSet (321l ), asList (2l , 3l , 123l , 321l ));
74
+ assertThat (doesNotContainAnyOf (123L , 321L ))
75
+ .matchesAll (emptyList (), singletonList ( 113L ))
76
+ .matchesNone (null , asList (1L , 123L ), asSet (321L ), asList (2L , 3L , 123L , 321L ));
76
77
}
77
78
79
+ @ Test
80
+ public void testDoesNotContainAllOf () {
81
+ assertThat (doesNotContainAllOf (123L , 321L ))
82
+ .matchesAll (emptyList (), singletonList (123L ), singletonList (321L ))
83
+ .matchesNone (null , asList (2L , 3L , 123L , 321L ));
84
+ }
78
85
}
0 commit comments