回答編集履歴
1
追記
test
CHANGED
@@ -7,3 +7,21 @@
|
|
7
7
|
.collect(Collectors.toList());
|
8
8
|
|
9
9
|
```
|
10
|
+
|
11
|
+
###追記
|
12
|
+
|
13
|
+
```Java
|
14
|
+
|
15
|
+
Comparator<Info> comparator = Comparator.<Info, String> comparing(info -> info.getSection().getSectionName())
|
16
|
+
|
17
|
+
.thenComparing(info -> info.getSection().getSectionCode());
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
List<Info> sortedList = infoList.stream()
|
22
|
+
|
23
|
+
.sorted(comparator)
|
24
|
+
|
25
|
+
.collect(Collectors.toList());
|
26
|
+
|
27
|
+
```
|