Browse Source

custom-set: use generics and tidy up tests

Frida Tveit 9 years ago
parent
commit
716cc180e6
1 changed files with 103 additions and 251 deletions
  1. 103
    251
      exercises/custom-set/src/test/java/CustomSetTest.java

+ 103
- 251
exercises/custom-set/src/test/java/CustomSetTest.java View File

1
+import org.junit.Ignore;
2
+import org.junit.Test;
1
 
3
 
2
 import java.util.Arrays;
4
 import java.util.Arrays;
3
 import java.util.Collections;
5
 import java.util.Collections;
4
-import static org.junit.Assert.assertFalse;
5
-import static org.junit.Assert.assertNotNull;
6
-import static org.junit.Assert.assertTrue;
7
-import org.junit.Test;
8
-import org.junit.Ignore;
6
+
7
+import static org.junit.Assert.*;
9
 
8
 
10
 public class CustomSetTest {
9
 public class CustomSetTest {
11
 
10
 
12
     @Test
11
     @Test
13
     public void setsWithNoElementsAreEmpty() {
12
     public void setsWithNoElementsAreEmpty() {
14
-        final boolean actual
15
-                = new CustomSet<>(Collections.emptyList())
16
-                        .isEmpty();
17
-        assertTrue(actual);
13
+        CustomSet<Integer> customSet = new CustomSet<>(Collections.emptyList());
14
+        assertTrue(customSet.isEmpty());
18
     }
15
     }
19
 
16
 
20
     @Ignore("Remove to run test")
17
     @Ignore("Remove to run test")
21
     @Test
18
     @Test
22
     public void setsWithElementsAreNotEmpty() {
19
     public void setsWithElementsAreNotEmpty() {
23
-        final boolean actual
24
-                = new CustomSet<>(Collections.singletonList(1))
25
-                        .isEmpty();
26
-
27
-        assertFalse(actual);
20
+        CustomSet<Integer> customSet = new CustomSet<>(Collections.singletonList(1));
21
+        assertFalse(customSet.isEmpty());
28
     }
22
     }
29
 
23
 
30
     @Ignore("Remove to run test")
24
     @Ignore("Remove to run test")
31
     @Test
25
     @Test
32
     public void nothingIsContainedInAnEmptySet() {
26
     public void nothingIsContainedInAnEmptySet() {
33
-        final boolean actual
34
-                = new CustomSet<>(Collections.emptyList())
35
-                        .contains(1);
36
-
37
-        assertFalse(actual);
27
+        CustomSet<Character> customSet = new CustomSet<>(Collections.emptyList());
28
+        assertFalse(customSet.contains('1'));
38
     }
29
     }
39
 
30
 
40
     @Ignore("Remove to run test")
31
     @Ignore("Remove to run test")
41
     @Test
32
     @Test
42
     public void whenTheElementIsInTheSet() {
33
     public void whenTheElementIsInTheSet() {
43
-        final boolean actual
44
-                = new CustomSet<>(Arrays.asList(1, 2, 3))
45
-                        .contains(1);
46
-
47
-        assertTrue(actual);
34
+        CustomSet<String> customSet = new CustomSet<>(Arrays.asList("1", "2", "3"));
35
+        assertTrue(customSet.contains("1"));
48
     }
36
     }
49
 
37
 
50
     @Ignore("Remove to run test")
38
     @Ignore("Remove to run test")
51
     @Test
39
     @Test
52
     public void whenTheElementIsNotInTheSet() {
40
     public void whenTheElementIsNotInTheSet() {
53
-        final boolean actual
54
-                = new CustomSet<>(Arrays.asList(1, 2, 3))
55
-                        .contains(4);
56
-
57
-        assertFalse(actual);
41
+        CustomSet<Integer> customSet = new CustomSet<>(Arrays.asList(1, 2, 3));
42
+        assertFalse(customSet.contains(4));
58
     }
43
     }
59
 
44
 
60
     @Ignore("Remove to run test")
45
     @Ignore("Remove to run test")
61
     @Test
46
     @Test
62
     public void emptySetIsASubsetOfAnotherEmptySet() {
47
     public void emptySetIsASubsetOfAnotherEmptySet() {
63
-        final boolean actual
64
-                = new CustomSet<>(Collections.emptyList())
65
-                        .isSubset(
66
-                                new CustomSet<>(Collections.emptyList())
67
-                        );
68
-
69
-        assertTrue(actual);
48
+        CustomSet<Integer> customSet = new CustomSet<>(Collections.emptyList());
49
+        CustomSet<Integer> secondCustomSet = new CustomSet<>(Collections.emptyList());
50
+        assertTrue(customSet.isSubset(secondCustomSet));
70
     }
51
     }
71
 
52
 
72
     @Ignore("Remove to run test")
53
     @Ignore("Remove to run test")
73
     @Test
54
     @Test
74
     public void emptySetIsASubsetOfNonEmptySet() {
55
     public void emptySetIsASubsetOfNonEmptySet() {
75
-        final boolean actual
76
-                = new CustomSet<>(Collections.singletonList(1))
77
-                        .isSubset(
78
-                                new CustomSet<>(Collections.emptyList())
79
-                        );
80
-
81
-        assertTrue(actual);
56
+        CustomSet<Character> customSet = new CustomSet<>(Collections.singletonList('1'));
57
+        CustomSet<Character> secondCustomSet = new CustomSet<>(Collections.emptyList());
58
+        assertTrue(customSet.isSubset(secondCustomSet));
82
     }
59
     }
83
 
60
 
84
     @Ignore("Remove to run test")
61
     @Ignore("Remove to run test")
85
     @Test
62
     @Test
86
     public void nonEmptySetIsNotASubsetOfEmptySet() {
63
     public void nonEmptySetIsNotASubsetOfEmptySet() {
87
-        final boolean actual
88
-                = new CustomSet<>(Collections.emptyList())
89
-                        .isSubset(
90
-                                new CustomSet<>(Collections.singletonList(1))
91
-                        );
92
-
93
-        assertFalse(actual);
64
+        CustomSet<Character> customSet = new CustomSet<>(Collections.emptyList());
65
+        CustomSet<Character> secondCustomSet = new CustomSet<>(Collections.singletonList('1'));
66
+        assertFalse(customSet.isSubset(secondCustomSet));
94
     }
67
     }
95
 
68
 
96
     @Ignore("Remove to run test")
69
     @Ignore("Remove to run test")
97
     @Test
70
     @Test
98
     public void setIsASubsetOfSetWithExactSameElements() {
71
     public void setIsASubsetOfSetWithExactSameElements() {
99
-        final boolean actual
100
-                = new CustomSet<>(Arrays.asList(1, 2, 3))
101
-                        .isSubset(
102
-                                new CustomSet<>(Arrays.asList(1, 2, 3))
103
-                        );
104
-
105
-        assertTrue(actual);
72
+        CustomSet<String> customSet = new CustomSet<>(Arrays.asList("1", "2", "3"));
73
+        CustomSet<String> secondCustomSet = new CustomSet<>(Arrays.asList("1", "2", "3"));
74
+        assertTrue(customSet.isSubset(secondCustomSet));
106
     }
75
     }
107
 
76
 
108
     @Ignore("Remove to run test")
77
     @Ignore("Remove to run test")
109
     @Test
78
     @Test
110
     public void setIsASubsetOfLargerSetWithSameElements() {
79
     public void setIsASubsetOfLargerSetWithSameElements() {
111
-        final boolean actual
112
-                = new CustomSet<>(Arrays.asList(4, 1, 2, 3))
113
-                        .isSubset(
114
-                                new CustomSet<>(Arrays.asList(1, 2, 3))
115
-                        );
116
-
117
-        assertTrue(actual);
80
+        CustomSet<Integer> customSet = new CustomSet<>(Arrays.asList(4, 1, 2, 3));
81
+        CustomSet<Integer> secondCustomSet = new CustomSet<>(Arrays.asList(1, 2, 3));
82
+        assertTrue(customSet.isSubset(secondCustomSet));
118
     }
83
     }
119
 
84
 
120
     @Ignore("Remove to run test")
85
     @Ignore("Remove to run test")
121
     @Test
86
     @Test
122
     public void setIsNotASubsetOfSetThatDoesNotContainItsElements() {
87
     public void setIsNotASubsetOfSetThatDoesNotContainItsElements() {
123
-        final boolean actual
124
-                = new CustomSet<>(Arrays.asList(4, 1, 3))
125
-                        .isSubset(
126
-                                new CustomSet<>(Arrays.asList(1, 2, 3))
127
-                        );
128
-
129
-        assertFalse(actual);
88
+        CustomSet<Integer> customSet = new CustomSet<>(Arrays.asList(4, 1, 3));
89
+        CustomSet<Integer> secondCustomSet = new CustomSet<>(Arrays.asList(1, 2, 3));
90
+        assertFalse(customSet.isSubset(secondCustomSet));
130
     }
91
     }
131
 
92
 
132
     @Ignore("Remove to run test")
93
     @Ignore("Remove to run test")
133
     @Test
94
     @Test
134
     public void theEmptySetIsDisjointWithItself() {
95
     public void theEmptySetIsDisjointWithItself() {
135
-        final boolean actual
136
-                = new CustomSet<>(Collections.emptyList())
137
-                        .isDisjoint(
138
-                                new CustomSet<>(Collections.emptyList())
139
-                        );
140
-
141
-        assertTrue(actual);
96
+        CustomSet<Integer> customSet = new CustomSet<>(Collections.emptyList());
97
+        CustomSet<Integer> secondCustomSet = new CustomSet<>(Collections.emptyList());
98
+        assertTrue(customSet.isDisjoint(secondCustomSet));
142
     }
99
     }
143
 
100
 
144
     @Ignore("Remove to run test")
101
     @Ignore("Remove to run test")
145
     @Test
102
     @Test
146
     public void emptySetIsDisjointWithNonEmptySet() {
103
     public void emptySetIsDisjointWithNonEmptySet() {
147
-        final boolean actual
148
-                = new CustomSet<>(Collections.emptyList())
149
-                        .isDisjoint(
150
-                                new CustomSet<>(Collections.singletonList(1))
151
-                        );
152
-
153
-        assertTrue(actual);
104
+        CustomSet<Integer> customSet = new CustomSet<>(Collections.emptyList());
105
+        CustomSet<Integer> secondCustomSet = new CustomSet<>(Collections.singletonList(1));
106
+        assertTrue(customSet.isDisjoint(secondCustomSet));
154
     }
107
     }
155
 
108
 
156
     @Ignore("Remove to run test")
109
     @Ignore("Remove to run test")
157
     @Test
110
     @Test
158
     public void nonEmptySetIsDisjointWithEmptySet() {
111
     public void nonEmptySetIsDisjointWithEmptySet() {
159
-        final boolean actual
160
-                = new CustomSet<>(Collections.singletonList(1))
161
-                        .isDisjoint(
162
-                                new CustomSet<>(Collections.emptyList())
163
-                        );
164
-
165
-        assertTrue(actual);
112
+        CustomSet<Character> customSet = new CustomSet<>(Collections.singletonList('1'));
113
+        CustomSet<Character> secondCustomSet = new CustomSet<>(Collections.emptyList());
114
+        assertTrue(customSet.isDisjoint(secondCustomSet));
166
     }
115
     }
167
 
116
 
168
     @Ignore("Remove to run test")
117
     @Ignore("Remove to run test")
169
     @Test
118
     @Test
170
     public void setsAreNotDisjointIfTheyShareAnElement() {
119
     public void setsAreNotDisjointIfTheyShareAnElement() {
171
-        final boolean actual
172
-                = new CustomSet<>(Arrays.asList(1, 2))
173
-                        .isDisjoint(
174
-                                new CustomSet<>(Arrays.asList(2, 3))
175
-                        );
176
-
177
-        assertFalse(actual);
120
+        CustomSet<Character> customSet = new CustomSet<>(Arrays.asList('1', '2'));
121
+        CustomSet<Character> secondCustomSet = new CustomSet<>(Arrays.asList('2', '3'));
122
+        assertFalse(customSet.isDisjoint(secondCustomSet));
178
     }
123
     }
179
 
124
 
180
     @Ignore("Remove to run test")
125
     @Ignore("Remove to run test")
181
     @Test
126
     @Test
182
     public void setsAreDisjointIfTheyShareNoElements() {
127
     public void setsAreDisjointIfTheyShareNoElements() {
183
-        final boolean actual
184
-                = new CustomSet<>(Arrays.asList(1, 2))
185
-                        .isDisjoint(
186
-                                new CustomSet<>(Arrays.asList(3, 4))
187
-                        );
188
-
189
-        assertTrue(actual);
128
+        CustomSet<String> customSet = new CustomSet<>(Arrays.asList("1", "2"));
129
+        CustomSet<String> secondCustomSet = new CustomSet<>(Arrays.asList("3", "4"));
130
+        assertTrue(customSet.isDisjoint(secondCustomSet));
190
     }
131
     }
191
 
132
 
192
     @Ignore("Remove to run test")
133
     @Ignore("Remove to run test")
193
     @Test
134
     @Test
194
     public void emptySetsAreEqual() {
135
     public void emptySetsAreEqual() {
195
-        final boolean actual
196
-                = new CustomSet<>(Collections.emptyList())
197
-                        .equals(
198
-                                new CustomSet<>(Collections.emptyList())
199
-                        );
200
-
201
-        assertTrue(actual);
136
+        CustomSet<String> customSet = new CustomSet<>(Collections.emptyList());
137
+        CustomSet<String> secondCustomSet = new CustomSet<>(Collections.emptyList());
138
+        assertTrue(customSet.equals(secondCustomSet));
202
     }
139
     }
203
 
140
 
204
     @Ignore("Remove to run test")
141
     @Ignore("Remove to run test")
205
     @Test
142
     @Test
206
     public void emptySetIsNotEqualToNonEmptySet() {
143
     public void emptySetIsNotEqualToNonEmptySet() {
207
-        final boolean actual
208
-                = new CustomSet<>(Collections.emptyList())
209
-                        .equals(
210
-                                new CustomSet<>(Arrays.asList(1, 2, 3))
211
-                        );
212
-
213
-        assertFalse(actual);
144
+        CustomSet<Integer> customSet = new CustomSet<>(Collections.emptyList());
145
+        CustomSet<Integer> secondCustomSet = new CustomSet<>(Arrays.asList(1, 2, 3));
146
+        assertFalse(customSet.equals(secondCustomSet));
214
     }
147
     }
215
 
148
 
216
     @Ignore("Remove to run test")
149
     @Ignore("Remove to run test")
217
     @Test
150
     @Test
218
     public void nonEmptySetIsNotEqualToEmptySet() {
151
     public void nonEmptySetIsNotEqualToEmptySet() {
219
-        final boolean actual
220
-                = new CustomSet<>(Arrays.asList(1, 2, 3))
221
-                        .equals(
222
-                                new CustomSet<>(Collections.emptyList())
223
-                        );
224
-
225
-        assertFalse(actual);
152
+        CustomSet<Integer> customSet = new CustomSet<>(Arrays.asList(1, 2, 3));
153
+        CustomSet<Integer> secondCustomSet = new CustomSet<>(Collections.emptyList());
154
+        assertFalse(customSet.equals(secondCustomSet));
226
     }
155
     }
227
 
156
 
228
     @Ignore("Remove to run test")
157
     @Ignore("Remove to run test")
229
     @Test
158
     @Test
230
     public void setsWithTheSameElementsAreEqual() {
159
     public void setsWithTheSameElementsAreEqual() {
231
-        final boolean actual
232
-                = new CustomSet<>(Arrays.asList(1, 2))
233
-                        .equals(
234
-                                new CustomSet<>(Arrays.asList(2, 1))
235
-                        );
236
-
237
-        assertTrue(actual);
160
+        CustomSet<Integer> customSet = new CustomSet<>(Arrays.asList(1, 2));
161
+        CustomSet<Integer> secondCustomSet = new CustomSet<>(Arrays.asList(2, 1));
162
+        assertTrue(customSet.equals(secondCustomSet));
238
     }
163
     }
239
 
164
 
240
     @Ignore("Remove to run test")
165
     @Ignore("Remove to run test")
241
     @Test
166
     @Test
242
     public void setsWithDifferentElementsAreNotEqual() {
167
     public void setsWithDifferentElementsAreNotEqual() {
243
-        final boolean actual
244
-                = new CustomSet<>(Arrays.asList(1, 2, 3))
245
-                        .equals(
246
-                                new CustomSet<>(Arrays.asList(1, 2, 4))
247
-                        );
248
-
249
-        assertFalse(actual);
168
+        CustomSet<Integer> customSet = new CustomSet<>(Arrays.asList(1, 2, 3));
169
+        CustomSet<Integer> secondCustomSet = new CustomSet<>(Arrays.asList(2, 1, 4));
170
+        assertFalse(customSet.equals(secondCustomSet));
250
     }
171
     }
251
 
172
 
252
     @Ignore("Remove to run test")
173
     @Ignore("Remove to run test")
253
     @Test
174
     @Test
254
     public void addToEmptySet() {
175
     public void addToEmptySet() {
255
-        final int element = 3;
256
-        final CustomSet<Integer> expected
257
-                = new CustomSet<>(
258
-                        Collections.unmodifiableList(Collections.singletonList(element))
259
-                );
260
-        final CustomSet<Integer> actual
261
-                = new CustomSet<>(Collections.emptyList());
176
+        char element = '3';
177
+        CustomSet<Character> expected = new CustomSet<>(Collections.unmodifiableList(Collections.singletonList(element)));
178
+        CustomSet<Character> actual = new CustomSet<>(Collections.emptyList());
262
 
179
 
263
         actual.add(element);
180
         actual.add(element);
264
 
181
 
270
     @Ignore("Remove to run test")
187
     @Ignore("Remove to run test")
271
     @Test
188
     @Test
272
     public void addToNonEmptySet() {
189
     public void addToNonEmptySet() {
273
-        final int element = 3;
274
-        final CustomSet<Integer> expected
275
-                = new CustomSet<>(
276
-                        Collections.unmodifiableList(Arrays.asList(1, 2, 3, 4))
277
-                );
278
-        final CustomSet<Integer> actual
279
-                = new CustomSet<>(Arrays.asList(1, 2, 4));
190
+        int element = 3;
191
+        CustomSet<Integer> expected = new CustomSet<>(Collections.unmodifiableList(Arrays.asList(1, 2, 3, 4)));
192
+        CustomSet<Integer> actual = new CustomSet<>(Arrays.asList(1, 2, 4));
280
 
193
 
281
         actual.add(element);
194
         actual.add(element);
282
 
195
 
288
     @Ignore("Remove to run test")
201
     @Ignore("Remove to run test")
289
     @Test
202
     @Test
290
     public void addingAnExistingElementDoesNotChangeTheSet() {
203
     public void addingAnExistingElementDoesNotChangeTheSet() {
291
-        final int element = 3;
292
-        final CustomSet<Integer> expected
293
-                = new CustomSet<>(
294
-                        Collections.unmodifiableList(Arrays.asList(1, 2, 3))
295
-                );
296
-        final CustomSet<Integer> actual
297
-                = new CustomSet<>(Arrays.asList(1, 2, 3));
204
+        String element = "3";
205
+        CustomSet<String> expected = new CustomSet<>(Collections.unmodifiableList(Arrays.asList("1", "2", "3")));
206
+        CustomSet<String> actual = new CustomSet<>(Arrays.asList("1", "2", "3"));
298
 
207
 
299
         actual.add(element);
208
         actual.add(element);
300
 
209
 
305
     @Ignore("Remove to run test")
214
     @Ignore("Remove to run test")
306
     @Test
215
     @Test
307
     public void intersectionOfTwoEmptySetsIsAnEmptySet() {
216
     public void intersectionOfTwoEmptySetsIsAnEmptySet() {
308
-        final CustomSet<Integer> actual
309
-                = new CustomSet<Integer>(Collections.emptyList())
310
-                        .getIntersection(
311
-                                new CustomSet<>(Collections.emptyList())
312
-                        );
217
+        CustomSet<Integer> actual = new CustomSet<Integer>(Collections.emptyList())
218
+                .getIntersection(new CustomSet<>(Collections.emptyList()));
313
 
219
 
314
         assertNotNull(actual);
220
         assertNotNull(actual);
315
         assertTrue(actual.isEmpty());
221
         assertTrue(actual.isEmpty());
318
     @Ignore("Remove to run test")
224
     @Ignore("Remove to run test")
319
     @Test
225
     @Test
320
     public void intersectionOfAnEmptySetAndNonEmptySetIsAnEmptySet() {
226
     public void intersectionOfAnEmptySetAndNonEmptySetIsAnEmptySet() {
321
-        final CustomSet<Integer> actual
322
-                = new CustomSet<Integer>(Collections.emptyList())
323
-                        .getIntersection(
324
-                                new CustomSet<>(Arrays.asList(3, 2, 5))
325
-                        );
227
+        CustomSet<Integer> actual = new CustomSet<Integer>(Collections.emptyList())
228
+                .getIntersection(new CustomSet<>(Arrays.asList(3, 2, 5)));
326
 
229
 
327
         assertNotNull(actual);
230
         assertNotNull(actual);
328
         assertTrue(actual.isEmpty());
231
         assertTrue(actual.isEmpty());
331
     @Ignore("Remove to run test")
234
     @Ignore("Remove to run test")
332
     @Test
235
     @Test
333
     public void intersectionOfANonEmptySetAndAnEmptySetIsAnEmptySet() {
236
     public void intersectionOfANonEmptySetAndAnEmptySetIsAnEmptySet() {
334
-        final CustomSet<Integer> actual
335
-                = new CustomSet<>(Arrays.asList(1, 2, 3, 4))
336
-                        .getIntersection(
337
-                                new CustomSet<>(Collections.emptyList())
338
-                        );
237
+        CustomSet<Character> actual = new CustomSet<>(Arrays.asList('1', '2', '3', '4'))
238
+                .getIntersection(new CustomSet<>(Collections.emptyList()));
339
 
239
 
340
         assertNotNull(actual);
240
         assertNotNull(actual);
341
         assertTrue(actual.isEmpty());
241
         assertTrue(actual.isEmpty());
345
     @Ignore("Remove to run test")
245
     @Ignore("Remove to run test")
346
     @Test
246
     @Test
347
     public void intersectionOfTwoSetsWithNoSharedElementsIsAnEmptySet() {
247
     public void intersectionOfTwoSetsWithNoSharedElementsIsAnEmptySet() {
348
-        final CustomSet<Integer> actual
349
-                = new CustomSet<>(Arrays.asList(1, 2, 3))
350
-                        .getIntersection(
351
-                                new CustomSet<>(Arrays.asList(4, 5, 6))
352
-                        );
248
+        CustomSet<Integer> actual = new CustomSet<>(Arrays.asList(1, 2, 3))
249
+                .getIntersection(new CustomSet<>(Arrays.asList(4, 5, 6)));
353
 
250
 
354
         assertNotNull(actual);
251
         assertNotNull(actual);
355
         assertTrue(actual.isEmpty());
252
         assertTrue(actual.isEmpty());
358
     @Ignore("Remove to run test")
255
     @Ignore("Remove to run test")
359
     @Test
256
     @Test
360
     public void intersectionOfTwoSetsWithSharedElementsIsASetOfTheSharedElements() {
257
     public void intersectionOfTwoSetsWithSharedElementsIsASetOfTheSharedElements() {
361
-        final CustomSet<Integer> expected
362
-                = new CustomSet<>(
363
-                        Collections.unmodifiableList(Arrays.asList(2, 3))
364
-                );
365
-        final CustomSet<Integer> actual
366
-                = new CustomSet<>(Arrays.asList(1, 2, 3, 4))
367
-                        .getIntersection(
368
-                                new CustomSet<>(Arrays.asList(3, 2, 5))
369
-                        );
258
+        CustomSet<Integer> expected = new CustomSet<>(Collections.unmodifiableList(Arrays.asList(2, 3)));
259
+        CustomSet<Integer> actual = new CustomSet<>(Arrays.asList(1, 2, 3, 4))
260
+                .getIntersection(new CustomSet<>(Arrays.asList(3, 2, 5)));
370
 
261
 
371
         assertNotNull(actual);
262
         assertNotNull(actual);
372
         assertFalse(actual.isEmpty());
263
         assertFalse(actual.isEmpty());
376
     @Ignore("Remove to run test")
267
     @Ignore("Remove to run test")
377
     @Test
268
     @Test
378
     public void differenceOfTwoEmptySetsIsAnEmptySet() {
269
     public void differenceOfTwoEmptySetsIsAnEmptySet() {
379
-        final CustomSet<Integer> actual
380
-                = new CustomSet<Integer>(Collections.emptyList())
381
-                        .getDifference(
382
-                                new CustomSet<>(Collections.emptyList())
383
-                        );
270
+        CustomSet<Integer> actual = new CustomSet<Integer>(Collections.emptyList())
271
+                .getDifference(new CustomSet<>(Collections.emptyList()));
384
 
272
 
385
         assertNotNull(actual);
273
         assertNotNull(actual);
386
         assertTrue(actual.isEmpty());
274
         assertTrue(actual.isEmpty());
389
     @Ignore("Remove to run test")
277
     @Ignore("Remove to run test")
390
     @Test
278
     @Test
391
     public void differenceOfAnEmptySetAndNonEmptySetIsAnEmptySet() {
279
     public void differenceOfAnEmptySetAndNonEmptySetIsAnEmptySet() {
392
-        final CustomSet<Integer> actual
393
-                = new CustomSet<Integer>(Collections.emptyList())
394
-                        .getDifference(
395
-                                new CustomSet<>(Arrays.asList(3, 2, 5))
396
-                        );
280
+        CustomSet<String> actual = new CustomSet<String>(Collections.emptyList())
281
+                .getDifference(new CustomSet<>(Arrays.asList("3", "2", "5")));
397
 
282
 
398
         assertNotNull(actual);
283
         assertNotNull(actual);
399
         assertTrue(actual.isEmpty());
284
         assertTrue(actual.isEmpty());
402
     @Ignore("Remove to run test")
287
     @Ignore("Remove to run test")
403
     @Test
288
     @Test
404
     public void differenceOfANonEmptySetAndAnEmptySetIsTheNonEmptySet() {
289
     public void differenceOfANonEmptySetAndAnEmptySetIsTheNonEmptySet() {
405
-        final CustomSet<Integer> expected
406
-                = new CustomSet<>(
407
-                        Collections.unmodifiableList(Arrays.asList(1, 2, 3, 4))
408
-                );
409
-        final CustomSet<Integer> actual
410
-                = new CustomSet<>(Arrays.asList(1, 2, 3, 4))
411
-                        .getDifference(
412
-                                new CustomSet<>(Collections.emptyList())
413
-                        );
290
+        CustomSet<Integer> expected = new CustomSet<>(Collections.unmodifiableList(Arrays.asList(1, 2, 3, 4)));
291
+        CustomSet<Integer> actual = new CustomSet<>(Arrays.asList(1, 2, 3, 4))
292
+                .getDifference(new CustomSet<>(Collections.emptyList()));
414
 
293
 
415
         assertNotNull(actual);
294
         assertNotNull(actual);
416
         assertFalse(actual.isEmpty());
295
         assertFalse(actual.isEmpty());
420
     @Ignore("Remove to run test")
299
     @Ignore("Remove to run test")
421
     @Test
300
     @Test
422
     public void differenceOfTwoNonEmptySetsIsASetOfElementsThatAreOnlyInTheFirstSet() {
301
     public void differenceOfTwoNonEmptySetsIsASetOfElementsThatAreOnlyInTheFirstSet() {
423
-        final CustomSet<Integer> expected
424
-                = new CustomSet<>(
425
-                        Collections.unmodifiableList(Arrays.asList(1, 3))
426
-                );
427
-        final CustomSet<Integer> actual
428
-                = new CustomSet<>(Arrays.asList(3, 2, 1))
429
-                        .getDifference(
430
-                                new CustomSet<>(Arrays.asList(2, 4))
431
-                        );
302
+        CustomSet<Integer> expected = new CustomSet<>(Collections.unmodifiableList(Arrays.asList(1, 3)));
303
+        CustomSet<Integer> actual = new CustomSet<>(Arrays.asList(3, 2, 1))
304
+                .getDifference(new CustomSet<>(Arrays.asList(2, 4)));
432
 
305
 
433
         assertNotNull(actual);
306
         assertNotNull(actual);
434
         assertFalse(actual.isEmpty());
307
         assertFalse(actual.isEmpty());
438
     @Ignore("Remove to run test")
311
     @Ignore("Remove to run test")
439
     @Test
312
     @Test
440
     public void unionOfTwoEmptySetsIsAnEmptySet() {
313
     public void unionOfTwoEmptySetsIsAnEmptySet() {
441
-        final CustomSet<Integer> actual
442
-                = new CustomSet<Integer>(Collections.emptyList())
443
-                        .getUnion(
444
-                                new CustomSet<>(Collections.emptyList())
445
-                        );
314
+        CustomSet<Integer> actual = new CustomSet<Integer>(Collections.emptyList())
315
+                .getUnion(new CustomSet<>(Collections.emptyList()));
446
 
316
 
447
         assertNotNull(actual);
317
         assertNotNull(actual);
448
         assertTrue(actual.isEmpty());
318
         assertTrue(actual.isEmpty());
451
     @Ignore("Remove to run test")
321
     @Ignore("Remove to run test")
452
     @Test
322
     @Test
453
     public void unionOfAnEmptySetAndNonEmptySetIsTheNonEmptySet() {
323
     public void unionOfAnEmptySetAndNonEmptySetIsTheNonEmptySet() {
454
-        final CustomSet<Integer> expected
455
-                = new CustomSet<>(
456
-                        Collections.unmodifiableList(Collections.singletonList(2))
457
-                );
458
-        final CustomSet<Integer> actual
459
-                = new CustomSet<Integer>(Collections.emptyList())
460
-                        .getUnion(
461
-                                new CustomSet<>(Collections.singletonList(2))
462
-                        );
324
+        CustomSet<Integer> expected = new CustomSet<>(Collections.unmodifiableList(Collections.singletonList(2)));
325
+        CustomSet<Integer> actual = new CustomSet<Integer>(Collections.emptyList())
326
+                .getUnion(new CustomSet<>(Collections.singletonList(2)));
463
 
327
 
464
         assertNotNull(actual);
328
         assertNotNull(actual);
465
         assertFalse(actual.isEmpty());
329
         assertFalse(actual.isEmpty());
469
     @Ignore("Remove to run test")
333
     @Ignore("Remove to run test")
470
     @Test
334
     @Test
471
     public void unionOfANonEmptySetAndAnEmptySetIsTheNonEmptySet() {
335
     public void unionOfANonEmptySetAndAnEmptySetIsTheNonEmptySet() {
472
-        final CustomSet<Integer> expected
473
-                = new CustomSet<>(
474
-                        Collections.unmodifiableList(Arrays.asList(1, 3))
475
-                );
476
-        final CustomSet<Integer> actual
477
-                = new CustomSet<>(Arrays.asList(1, 3))
478
-                        .getUnion(
479
-                                new CustomSet<>(Collections.emptyList())
480
-                        );
336
+        CustomSet<Integer> expected = new CustomSet<>(Collections.unmodifiableList(Arrays.asList(1, 3)));
337
+        CustomSet<Integer> actual = new CustomSet<>(Arrays.asList(1, 3))
338
+                .getUnion(new CustomSet<>(Collections.emptyList()));
481
 
339
 
482
         assertNotNull(actual);
340
         assertNotNull(actual);
483
         assertFalse(actual.isEmpty());
341
         assertFalse(actual.isEmpty());
487
     @Ignore("Remove to run test")
345
     @Ignore("Remove to run test")
488
     @Test
346
     @Test
489
     public void unionOfTwoNonEmptySetsContainsAllUniqueElements() {
347
     public void unionOfTwoNonEmptySetsContainsAllUniqueElements() {
490
-        final CustomSet<Integer> expected
491
-                = new CustomSet<>(
492
-                        Collections.unmodifiableList(Arrays.asList(3, 2, 1))
493
-                );
494
-        final CustomSet<Integer> actual
495
-                = new CustomSet<>(Arrays.asList(1, 3))
496
-                        .getUnion(
497
-                                new CustomSet<>(Arrays.asList(2, 3))
498
-                        );
348
+        CustomSet<Character> expected = new CustomSet<>(Collections.unmodifiableList(Arrays.asList('3', '2', '1')));
349
+        CustomSet<Character> actual = new CustomSet<>(Arrays.asList('1', '3'))
350
+                .getUnion(new CustomSet<>(Arrays.asList('2', '3')));
499
 
351
 
500
         assertNotNull(actual);
352
         assertNotNull(actual);
501
         assertFalse(actual.isEmpty());
353
         assertFalse(actual.isEmpty());