|
@@ -33,19 +33,6 @@ public class StringArrayUtilsTest {
|
33
|
33
|
Assert.assertEquals(expected, actual);
|
34
|
34
|
}
|
35
|
35
|
|
36
|
|
-
|
37
|
|
-
|
38
|
|
-
|
39
|
|
-
|
40
|
|
-
|
41
|
|
-
|
42
|
|
-
|
43
|
|
-
|
44
|
|
-
|
45
|
|
-
|
46
|
|
-
|
47
|
|
-
|
48
|
|
-
|
49
|
36
|
@Test
|
50
|
37
|
public void testGetSecondElement1() {
|
51
|
38
|
String[] array = {"the", "quick", "brown", "fox", "jumps", "over", "the", "lazy", "dog"};
|
|
@@ -61,8 +48,6 @@ public class StringArrayUtilsTest {
|
61
|
48
|
String actual = StringArrayUtils.getSecondElement(array);
|
62
|
49
|
Assert.assertEquals(expected, actual);
|
63
|
50
|
}
|
64
|
|
-
|
65
|
|
-
|
66
|
51
|
@Test
|
67
|
52
|
public void testGetSecondElement3() {
|
68
|
53
|
String[] array = {"brown", "fox", "jumps", "over", "the", "lazy", "dog"};
|
|
@@ -70,17 +55,6 @@ public class StringArrayUtilsTest {
|
70
|
55
|
String actual = StringArrayUtils.getSecondElement(array);
|
71
|
56
|
Assert.assertEquals(expected, actual);
|
72
|
57
|
}
|
73
|
|
-
|
74
|
|
-
|
75
|
|
-
|
76
|
|
-
|
77
|
|
-
|
78
|
|
-
|
79
|
|
-
|
80
|
|
-
|
81
|
|
-
|
82
|
|
-
|
83
|
|
-
|
84
|
58
|
@Test
|
85
|
59
|
public void testGetLastElement1() {
|
86
|
60
|
String[] array = {"the", "quick", "brown", "fox", "jumps", "over", "the", "lazy", "dog"};
|
|
@@ -88,7 +62,6 @@ public class StringArrayUtilsTest {
|
88
|
62
|
String actual = StringArrayUtils.getLastElement(array);
|
89
|
63
|
Assert.assertEquals(expected, actual);
|
90
|
64
|
}
|
91
|
|
-
|
92
|
65
|
@Test
|
93
|
66
|
public void testGetLastElement2() {
|
94
|
67
|
String[] array = {"the", "quick", "brown", "fox", "jumps", "over", "the", "lazy"};
|
|
@@ -96,8 +69,6 @@ public class StringArrayUtilsTest {
|
96
|
69
|
String actual = StringArrayUtils.getLastElement(array);
|
97
|
70
|
Assert.assertEquals(expected, actual);
|
98
|
71
|
}
|
99
|
|
-
|
100
|
|
-
|
101
|
72
|
@Test
|
102
|
73
|
public void testGetLastElement3() {
|
103
|
74
|
String[] array = {"the", "quick", "brown", "fox", "jumps", "over"};
|
|
@@ -105,27 +76,6 @@ public class StringArrayUtilsTest {
|
105
|
76
|
String actual = StringArrayUtils.getLastElement(array);
|
106
|
77
|
Assert.assertEquals(expected, actual);
|
107
|
78
|
}
|
108
|
|
-
|
109
|
|
-
|
110
|
|
-
|
111
|
|
-
|
112
|
|
-
|
113
|
|
-
|
114
|
|
-
|
115
|
|
-
|
116
|
|
-
|
117
|
|
-
|
118
|
|
-
|
119
|
|
-
|
120
|
|
-
|
121
|
|
-
|
122
|
|
-
|
123
|
|
-
|
124
|
|
-
|
125
|
|
-
|
126
|
|
-
|
127
|
|
-
|
128
|
|
-
|
129
|
79
|
@Test
|
130
|
80
|
public void testGetSecondToLastElement1() {
|
131
|
81
|
String[] array = {"the", "quick", "brown", "fox", "jumps", "over", "the", "lazy", "dog"};
|
|
@@ -133,7 +83,6 @@ public class StringArrayUtilsTest {
|
133
|
83
|
String actual = StringArrayUtils.getSecondToLastElement(array);
|
134
|
84
|
Assert.assertEquals(expected, actual);
|
135
|
85
|
}
|
136
|
|
-
|
137
|
86
|
@Test
|
138
|
87
|
public void testGetSecondToLastElement2() {
|
139
|
88
|
String[] array = {"the", "quick", "brown", "fox", "jumps", "over", "lazy"};
|
|
@@ -141,8 +90,6 @@ public class StringArrayUtilsTest {
|
141
|
90
|
String actual = StringArrayUtils.getSecondToLastElement(array);
|
142
|
91
|
Assert.assertEquals(expected, actual);
|
143
|
92
|
}
|
144
|
|
-
|
145
|
|
-
|
146
|
93
|
@Test
|
147
|
94
|
public void testGetSecondToLastElement3() {
|
148
|
95
|
String[] array = {"the", "quick", "brown", "fox", "jumps", "over"};
|
|
@@ -150,23 +97,6 @@ public class StringArrayUtilsTest {
|
150
|
97
|
String actual = StringArrayUtils.getSecondToLastElement(array);
|
151
|
98
|
Assert.assertEquals(expected, actual);
|
152
|
99
|
}
|
153
|
|
-
|
154
|
|
-
|
155
|
|
-
|
156
|
|
-
|
157
|
|
-
|
158
|
|
-
|
159
|
|
-
|
160
|
|
-
|
161
|
|
-
|
162
|
|
-
|
163
|
|
-
|
164
|
|
-
|
165
|
|
-
|
166
|
|
-
|
167
|
|
-
|
168
|
|
-
|
169
|
|
-
|
170
|
100
|
@Test
|
171
|
101
|
public void testContains() {
|
172
|
102
|
String[] array = {"the", "quick", "brown", "fox", "jumps", "over", "the", "lazy", "dog"};
|
|
@@ -175,19 +105,6 @@ public class StringArrayUtilsTest {
|
175
|
105
|
Assert.assertTrue(outcome);
|
176
|
106
|
}
|
177
|
107
|
}
|
178
|
|
-
|
179
|
|
-
|
180
|
|
-
|
181
|
|
-
|
182
|
|
-
|
183
|
|
-
|
184
|
|
-
|
185
|
|
-
|
186
|
|
-
|
187
|
|
-
|
188
|
|
-
|
189
|
|
-
|
190
|
|
-
|
191
|
108
|
@Test
|
192
|
109
|
public void testReverse1() {
|
193
|
110
|
String[] array = {"the", "quick", "brown", "fox", "jumps", "over", "the", "lazy", "dog"};
|
|
@@ -195,8 +112,6 @@ public class StringArrayUtilsTest {
|
195
|
112
|
String[] actual = StringArrayUtils.reverse(array);
|
196
|
113
|
Assert.assertEquals(expected, actual);
|
197
|
114
|
}
|
198
|
|
-
|
199
|
|
-
|
200
|
115
|
@Test
|
201
|
116
|
public void testReverse2() {
|
202
|
117
|
String[] array = {"dog", "lazy", "the", "over", "jumps", "fox", "brown", "quick", "the"};
|
|
@@ -204,97 +119,54 @@ public class StringArrayUtilsTest {
|
204
|
119
|
String[] actual = StringArrayUtils.reverse(array);
|
205
|
120
|
Assert.assertEquals(expected, actual);
|
206
|
121
|
}
|
207
|
|
-
|
208
|
|
-
|
209
|
122
|
@Test
|
210
|
123
|
public void testReverse3() {
|
211
|
124
|
String[] expected = {"the", "quick", "brown", "fox", "jumps", "over", "the", "lazy", "dog"};
|
212
|
125
|
String[] actual = StringArrayUtils.reverse(StringArrayUtils.reverse(expected));
|
213
|
126
|
Assert.assertEquals(expected, actual);
|
214
|
127
|
}
|
215
|
|
-
|
216
|
|
-
|
217
|
|
-
|
218
|
|
-
|
219
|
|
-
|
220
|
|
-
|
221
|
|
-
|
222
|
|
-
|
223
|
|
-
|
224
|
|
-
|
225
|
128
|
@Test
|
226
|
129
|
public void testIsPalindromic1() {
|
227
|
130
|
String[] array = {"a", "b", "c", "b", "a"};
|
228
|
131
|
boolean outcome = StringArrayUtils.isPalindromic(array);
|
229
|
132
|
Assert.assertTrue(outcome);
|
230
|
133
|
}
|
231
|
|
-
|
232
|
|
-
|
233
|
|
-
|
234
|
134
|
@Test
|
235
|
135
|
public void testIsPalindromic2() {
|
236
|
136
|
String[] array = {"Is this a palindrome?", "This is a palindrome", "Is this a palindrome?"};
|
237
|
137
|
boolean outcome = StringArrayUtils.isPalindromic(array);
|
238
|
138
|
Assert.assertTrue(outcome);
|
239
|
139
|
}
|
240
|
|
-
|
241
|
|
-
|
242
|
140
|
@Test
|
243
|
141
|
public void testIsPalindromic3() {
|
244
|
142
|
String[] array = {"Is this a plaindrome?", "This is not a plaindrome", "Is this a palindrome?", "This is not a palindrome"};
|
245
|
143
|
boolean outcome = StringArrayUtils.isPalindromic(array);
|
246
|
144
|
Assert.assertFalse(outcome);
|
247
|
145
|
}
|
248
|
|
-
|
249
|
|
-
|
250
|
|
-
|
251
|
|
-
|
252
|
|
-
|
253
|
|
-
|
254
|
|
-
|
255
|
|
-
|
256
|
|
-
|
257
|
146
|
@Test
|
258
|
147
|
public void testIsPangramic1() {
|
259
|
148
|
String[] array = {"The quick brown", "Fox jumps over", "The lazy dog"};
|
260
|
149
|
boolean outcome = StringArrayUtils.isPangramic(array);
|
261
|
150
|
Assert.assertTrue(outcome);
|
262
|
151
|
}
|
263
|
|
-
|
264
|
152
|
@Test
|
265
|
153
|
public void testIsPangramic2() {
|
266
|
154
|
String[] array = {"The", "quick", "onyx", "goblin", "jumps", "over", "the", "lazy", "dwarf"};
|
267
|
155
|
boolean outcome = StringArrayUtils.isPangramic(array);
|
268
|
156
|
Assert.assertTrue(outcome);
|
269
|
157
|
}
|
270
|
|
-
|
271
|
158
|
@Test
|
272
|
159
|
public void testIsPangramic3() {
|
273
|
160
|
String[] array = {"Five quacking", "zephyrs", "jolt my", "wax bed"};
|
274
|
161
|
boolean outcome = StringArrayUtils.isPangramic(array);
|
275
|
162
|
Assert.assertTrue(outcome);
|
276
|
163
|
}
|
277
|
|
-
|
278
|
|
-
|
279
|
164
|
@Test
|
280
|
165
|
public void testIsPangramic4() {
|
281
|
166
|
String[] array = {"a", "b", "c", "d"};
|
282
|
167
|
boolean outcome = StringArrayUtils.isPangramic(array);
|
283
|
168
|
Assert.assertFalse(outcome);
|
284
|
169
|
}
|
285
|
|
-
|
286
|
|
-
|
287
|
|
-
|
288
|
|
-
|
289
|
|
-
|
290
|
|
-
|
291
|
|
-
|
292
|
|
-
|
293
|
|
-
|
294
|
|
-
|
295
|
|
-
|
296
|
|
-
|
297
|
|
-
|
298
|
170
|
@Test
|
299
|
171
|
public void testGetNumberOfOccurrences1() {
|
300
|
172
|
String[] array = {"aba", "aba", "baa", "bab", "bba", "bba", "bba", "bba", "bbb", "bbb"};
|
|
@@ -302,7 +174,6 @@ public class StringArrayUtilsTest {
|
302
|
174
|
int actual = StringArrayUtils.getNumberOfOccurrences(array, "bba");
|
303
|
175
|
Assert.assertEquals(actual, expected);
|
304
|
176
|
}
|
305
|
|
-
|
306
|
177
|
@Test
|
307
|
178
|
public void testGetNumberOfOccurrences2() {
|
308
|
179
|
String[] array = {"aba", "aba", "baa", "bab", "bba", "bba", "bba", "bba", "bbb", "bbb"};
|
|
@@ -310,7 +181,6 @@ public class StringArrayUtilsTest {
|
310
|
181
|
int actual = StringArrayUtils.getNumberOfOccurrences(array, "bbb");
|
311
|
182
|
Assert.assertEquals(actual, expected);
|
312
|
183
|
}
|
313
|
|
-
|
314
|
184
|
@Test
|
315
|
185
|
public void testGetNumberOfOccurrences3() {
|
316
|
186
|
String[] array = {"aba", "aba", "baa", "bab", "bba", "bba", "bba", "bba", "bbb", "bbb"};
|
|
@@ -318,20 +188,6 @@ public class StringArrayUtilsTest {
|
318
|
188
|
int actual = StringArrayUtils.getNumberOfOccurrences(array, "bba");
|
319
|
189
|
Assert.assertEquals(actual, expected);
|
320
|
190
|
}
|
321
|
|
-
|
322
|
|
-
|
323
|
|
-
|
324
|
|
-
|
325
|
|
-
|
326
|
|
-
|
327
|
|
-
|
328
|
|
-
|
329
|
|
-
|
330
|
|
-
|
331
|
|
-
|
332
|
|
-
|
333
|
|
-
|
334
|
|
-
|
335
|
191
|
@Test
|
336
|
192
|
public void testRemoveConsecutiveDuplicates1() {
|
337
|
193
|
String[] array = {"aba", "aba", "baa", "bab", "bba", "bba", "bba", "bba", "bbb", "bbb"};
|
|
@@ -339,9 +195,6 @@ public class StringArrayUtilsTest {
|
339
|
195
|
String[] expected = {"aba", "baa", "bab", "bba", "bbb"};
|
340
|
196
|
Assert.assertEquals(actual, expected);
|
341
|
197
|
}
|
342
|
|
-
|
343
|
|
-
|
344
|
|
-
|
345
|
198
|
@Test
|
346
|
199
|
public void testRemoveConsecutiveDuplicates2() {
|
347
|
200
|
String[] array = {"aba", "aba", "baa", "bab", "bba", "zzz", "bba", "bba", "bba", "bbb", "bbb"};
|