|
7 | 7 |
|
8 | 8 | import java.util.stream.Stream; |
9 | 9 |
|
10 | | -public class CollectorExtTest { |
| 10 | +public class CollectorsTest { |
11 | 11 |
|
12 | 12 | @Test |
13 | 13 | public void test_distinctFirstPut() { |
14 | 14 | Assertions.assertThat( |
15 | 15 | Stream.of("A", "B", "A", "C") |
16 | | - .collect(CollectorExt.Distinct.distinctFirstPut())) |
| 16 | + .collect(Collectors.Distinct.distinctFirstPut())) |
17 | 17 | .containsExactly("A", "B", "C"); |
18 | 18 | } |
19 | 19 |
|
20 | 20 | @Test |
21 | 21 | public void test_distinctLastPut() { |
22 | 22 | Assertions.assertThat( |
23 | 23 | Stream.of("A", "B", "A", "C") |
24 | | - .collect(CollectorExt.Distinct.distinctLastPut())) |
| 24 | + .collect(Collectors.Distinct.distinctLastPut())) |
25 | 25 | .containsExactly("B", "A", "C"); |
26 | 26 | } |
27 | 27 |
|
28 | 28 | @Test |
29 | 29 | public void test_distinctFirstPutByKey() { |
30 | 30 | Assertions.assertThat( |
31 | 31 | Stream.of(new DataInfo("A", "A1"), new DataInfo("B", "B1"), new DataInfo("A", "A2"), new DataInfo("C", "C1")) |
32 | | - .collect(CollectorExt.Distinct.distinctFirstPutByKey(DataInfo::getKey))) |
| 32 | + .collect(Collectors.Distinct.distinctFirstPutByKey(DataInfo::getKey))) |
33 | 33 | .containsExactly(new DataInfo("A", "A1"), new DataInfo("B", "B1"), new DataInfo("C", "C1")); |
34 | 34 | } |
35 | 35 |
|
36 | 36 | @Test |
37 | 37 | public void test_distinctLastPutByKey() { |
38 | 38 | Assertions.assertThat( |
39 | 39 | Stream.of(new DataInfo("A", "A1"), new DataInfo("B", "B1"), new DataInfo("A", "A2"), new DataInfo("C", "C1")) |
40 | | - .collect(CollectorExt.Distinct.distinctLastPutByKey(DataInfo::getKey))) |
| 40 | + .collect(Collectors.Distinct.distinctLastPutByKey(DataInfo::getKey))) |
41 | 41 | .containsExactly(new DataInfo("B", "B1"), new DataInfo("A", "A2"), new DataInfo("C", "C1")); |
42 | 42 | } |
43 | 43 |
|
|
0 commit comments