|
|
@@ -2,6 +2,7 @@ import org.junit.Ignore;
|
|
2
|
2
|
import org.junit.Test;
|
|
3
|
3
|
|
|
4
|
4
|
import java.util.Arrays;
|
|
|
5
|
+import java.util.Collections;
|
|
5
|
6
|
import java.util.List;
|
|
6
|
7
|
|
|
7
|
8
|
import static org.hamcrest.CoreMatchers.*;
|
|
|
@@ -53,7 +54,7 @@ public class AnagramTest {
|
|
53
|
54
|
@Test
|
|
54
|
55
|
public void testDoesNotConfuseDifferentDuplicates() {
|
|
55
|
56
|
Anagram detector = new Anagram("galea");
|
|
56
|
|
- assertTrue(detector.match(Arrays.asList("eagle")).isEmpty());
|
|
|
57
|
+ assertTrue(detector.match(Collections.singletonList("eagle")).isEmpty());
|
|
57
|
58
|
}
|
|
58
|
59
|
|
|
59
|
60
|
@Ignore("Remove to run test")
|
|
|
@@ -69,21 +70,21 @@ public class AnagramTest {
|
|
69
|
70
|
@Test
|
|
70
|
71
|
public void testIdenticalWordRepeatedIsNotAnagram() {
|
|
71
|
72
|
Anagram detector = new Anagram("go");
|
|
72
|
|
- assertTrue(detector.match(Arrays.asList("go Go GO")).isEmpty());
|
|
|
73
|
+ assertTrue(detector.match(Collections.singletonList("go Go GO")).isEmpty());
|
|
73
|
74
|
}
|
|
74
|
75
|
|
|
75
|
76
|
@Ignore("Remove to run test")
|
|
76
|
77
|
@Test
|
|
77
|
78
|
public void testCapitalWordIsNotOwnAnagram() {
|
|
78
|
79
|
Anagram detector = new Anagram("BANANA");
|
|
79
|
|
- assertTrue(detector.match(Arrays.asList("Banana")).isEmpty());
|
|
|
80
|
+ assertTrue(detector.match(Collections.singletonList("Banana")).isEmpty());
|
|
80
|
81
|
}
|
|
81
|
82
|
|
|
82
|
83
|
@Ignore("Remove to run test")
|
|
83
|
84
|
@Test
|
|
84
|
85
|
public void testEliminateAnagramsWithSameChecksum() {
|
|
85
|
86
|
Anagram detector = new Anagram("mass");
|
|
86
|
|
- assertTrue(detector.match(Arrays.asList("last")).isEmpty());
|
|
|
87
|
+ assertTrue(detector.match(Collections.singletonList("last")).isEmpty());
|
|
87
|
88
|
}
|
|
88
|
89
|
|
|
89
|
90
|
@Ignore("Remove to run test")
|
|
|
@@ -121,13 +122,13 @@ public class AnagramTest {
|
|
121
|
122
|
@Test
|
|
122
|
123
|
public void testWordIsNotItsOwnAnagram() {
|
|
123
|
124
|
Anagram detector = new Anagram("banana");
|
|
124
|
|
- assertTrue(detector.match(Arrays.asList("Banana")).isEmpty());
|
|
|
125
|
+ assertTrue(detector.match(Collections.singletonList("Banana")).isEmpty());
|
|
125
|
126
|
}
|
|
126
|
127
|
|
|
127
|
128
|
@Ignore("Remove to run test")
|
|
128
|
129
|
@Test
|
|
129
|
130
|
public void testAnagramMustUseAllLettersExactlyOnce() {
|
|
130
|
131
|
Anagram detector = new Anagram("tapper");
|
|
131
|
|
- assertTrue(detector.match(Arrays.asList("patter")).isEmpty());
|
|
|
132
|
+ assertTrue(detector.match(Collections.singletonList("patter")).isEmpty());
|
|
132
|
133
|
}
|
|
133
|
134
|
}
|