Replace Collectors.toList with Stream.toList

Closes gh-29203
This commit is contained in:
Adam Ostrožlík
2022-09-26 14:04:43 +02:00
committed by Brian Clozel
parent 9d263668d5
commit 0ccb64fe10
49 changed files with 62 additions and 106 deletions

View File

@@ -27,7 +27,6 @@ import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.stream.Collectors;
import okhttp3.mockwebserver.MockResponse;
import okhttp3.mockwebserver.MockWebServer;
@@ -523,7 +522,7 @@ class RestTemplateTests {
final List<List<String>> accepts = request.getHeaders().toMultimap().entrySet().stream()
.filter(entry -> entry.getKey().equalsIgnoreCase("accept"))
.map(Entry::getValue)
.collect(Collectors.toList());
.toList();
assertThat(accepts).hasSize(1);
assertThat(accepts.get(0)).hasSize(1);