-
Notifications
You must be signed in to change notification settings - Fork 174
Expand file tree
/
Copy pathGetConsecutiveDuplicatesTest.java
More file actions
37 lines (26 loc) · 1.23 KB
/
GetConsecutiveDuplicatesTest.java
File metadata and controls
37 lines (26 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package com.zipcodewilmington;
import org.junit.Assert;
import org.junit.Test;
public class GetConsecutiveDuplicatesTest {
@Test
public void testRemoveConsecutiveDuplicates1() {
String[] array = {"aba", "aba", "baa", "bab", "bba", "bba", "bba", "bba", "bbb", "bbb"};
String[] actual = StringArrayUtils.removeConsecutiveDuplicates(array);
String[] expected = {"aba", "baa", "bab", "bba", "bbb"};
Assert.assertEquals(actual, expected);
}
@Test
public void testRemoveConsecutiveDuplicates2() {
String[] array = {"aba", "aba", "baa", "bab", "bba", "zzz", "bba", "bba", "bba", "bbb", "bbb"};
String[] actual = StringArrayUtils.removeConsecutiveDuplicates(array);
String[] expected = {"aba", "baa", "bab", "bba", "zzz", "bba", "bbb"};
Assert.assertEquals(actual, expected);
}
@Test
public void testRemoveConsecutiveDuplicates3() {
String[] array = {"aba", "aba", "baa", "bab", "bba", "zzz", "bba", "bba", "bba", "aba", "bbb"};
String[] actual = StringArrayUtils.removeConsecutiveDuplicates(array);
String[] expected = {"aba", "baa", "bab", "bba", "zzz", "bba", "aba", "bbb"};
Assert.assertEquals(actual, expected);
}
}