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

@@ -26,7 +26,6 @@ import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.stream.Collectors;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -88,7 +87,7 @@ public abstract class TestPropertySourceUtils {
// Convert all the merged annotations for the current aggregate
// level to a list of TestPropertySourceAttributes.
List<TestPropertySourceAttributes> aggregatedAttributesList =
aggregatedAnnotations.stream().map(TestPropertySourceAttributes::new).collect(Collectors.toList());
aggregatedAnnotations.stream().map(TestPropertySourceAttributes::new).toList();
// Merge all TestPropertySourceAttributes instances for the current
// aggregate level into a single TestPropertySourceAttributes instance.
TestPropertySourceAttributes mergedAttributes = mergeTestPropertySourceAttributes(aggregatedAttributesList);