File tree Expand file tree Collapse file tree 4 files changed +4
-4
lines changed Expand file tree Collapse file tree 4 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,6 @@ public String parse(Event event) {
43
43
public List <String > parse (List <Event > events ) {
44
44
return events .stream ()
45
45
.map (this ::parse )
46
- .collect ( Collectors . toList () );
46
+ .toList ();
47
47
}
48
48
}
Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ public List<Node> findEquivalentSubtrees(Node root) {
62
62
entry -> entry .getValue ().stream ()
63
63
.sorted ((o1 , o2 ) -> node2Size .get (o2 ) - node2Size .get (o1 ))
64
64
.limit (2 )
65
- .collect ( Collectors . toList () )
65
+ .toList ()
66
66
));
67
67
// Only absent sets with at least 2 related nodes remain
68
68
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ private void checkIsFinished(HanoiTowers ht) {
36
36
assertTrue ("Left column should be empty" , ht .getLeft ().getStack ().isEmpty ());
37
37
assertTrue ("Middle column should be empty" , ht .getMiddle ().getStack ().isEmpty ());
38
38
39
- List <Integer > disks = ht .getRight ().getStack ().stream ().collect ( Collectors . toList () );
39
+ List <Integer > disks = ht .getRight ().getStack ().stream ().toList ();
40
40
for (int i = 1 ; i < disks .size (); i ++) {
41
41
assertThat ("Disk " + (i - 1 ) + " should be less than disk " + i ,
42
42
disks .get (i - 1 ),
Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ public void backwardVerticalWalk() {
55
55
}
56
56
57
57
private void checkResultList (List <BinaryTreeWalking .Node <Integer >> result , int [] expectation ) {
58
- List <Integer > values = result .stream ().map (node -> node . getValue ()). collect ( Collectors . toList () );
58
+ List <Integer > values = result .stream ().map (BinaryTreeWalking . Node :: getValue ). toList ();
59
59
assertThat (values .size (), is (expectation .length ));
60
60
assertThat (values .toArray (), is (expectation ));
61
61
}
You can’t perform that action at this time.
0 commit comments