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

@@ -18,7 +18,6 @@ package org.springframework.context.annotation;
import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;
import org.junit.jupiter.api.Test;
@@ -156,7 +155,7 @@ class ConfigurationClassAndBeanMethodTests {
private static List<BeanMethod> getBeanMethods(ConfigurationClass configurationClass) {
List<BeanMethod> beanMethods = configurationClass.getBeanMethods().stream()
.sorted(Comparator.comparing(beanMethod -> beanMethod.getMetadata().getMethodName()))
.collect(Collectors.toList());
.toList();
assertThat(beanMethods).hasSize(3);
return beanMethods;
}