Repository navigation
Expand file tree
/
Copy pathCollectorsTest.java
More file actions
60 lines (46 loc) · 1.59 KB
/
Copy pathCollectorsTest.java
File metadata and controls
60 lines (46 loc) · 1.59 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
package org.jooby.fn;
import static org.junit.Assert.assertEquals;
import org.jooby.util.Collectors;
import org.junit.Test;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
public class CollectorsTest {
@Test
public void sillyJacoco() {
new Collectors();
}
@Test
public void listAddOne() {
assertEquals(Lists.newArrayList("1", Lists.newArrayList("1")),
Lists.newArrayList("1", Lists.newArrayList("1")).stream().collect(Collectors.toList()));
}
@Test
public void listAddTwo() {
assertEquals(Lists.newArrayList("1", "2"),
Lists.newArrayList("1", "2").stream().collect(Collectors.toList()));
}
@Test
public void listAddMore() {
assertEquals(Lists.newArrayList("1", "2", "3"),
Lists.newArrayList("1", "2", "3").stream().collect(Collectors.toList()));
assertEquals(Lists.newArrayList("1", "2", "3", "4"),
Lists.newArrayList("1", "2", "3", "4").stream().collect(Collectors.toList()));
}
@Test
public void setAddOne() {
assertEquals(Sets.newHashSet("1"),
Lists.newArrayList("1").stream().collect(Collectors.toSet()));
}
@Test
public void setAddTwo() {
assertEquals(Sets.newHashSet("1", "2"),
Lists.newArrayList("1", "2").stream().collect(Collectors.toSet()));
}
@Test
public void setAddMore() {
assertEquals(Sets.newHashSet("1", "2", "3"),
Lists.newArrayList("1", "2", "3").stream().collect(Collectors.toSet()));
assertEquals(Sets.newHashSet("1", "2", "3", "4"),
Lists.newArrayList("1", "2", "3", "4").stream().collect(Collectors.toSet()));
}
}