diff --git a/spring-core/src/test/java/org/springframework/core/annotation/MergedAnnotationsTests.java b/spring-core/src/test/java/org/springframework/core/annotation/MergedAnnotationsTests.java index 96c91e13da..90dbbe9478 100644 --- a/spring-core/src/test/java/org/springframework/core/annotation/MergedAnnotationsTests.java +++ b/spring-core/src/test/java/org/springframework/core/annotation/MergedAnnotationsTests.java @@ -412,8 +412,7 @@ class MergedAnnotationsTests { MultiValueMap map = MergedAnnotations.from( SubClassWithInheritedAnnotation.class, SearchStrategy.INHERITED_ANNOTATIONS) .stream(Transactional.class).collect(MergedAnnotationCollectors.toMultiValueMap()); - assertThat(map).contains( - entry("qualifier", Arrays.asList("composed2", "transactionManager"))); + assertThat(map).contains(entry("qualifier", List.of("composed2", "transactionManager"))); } @Test @@ -456,8 +455,7 @@ class MergedAnnotationsTests { MultiValueMap map = MergedAnnotations.from( TxFromMultipleComposedAnnotations.class, SearchStrategy.INHERITED_ANNOTATIONS) .stream(Transactional.class).collect(MergedAnnotationCollectors.toMultiValueMap()); - assertThat(map).contains( - entry("value", Arrays.asList("TxInheritedComposed", "TxComposed"))); + assertThat(map).contains(entry("value", List.of("TxInheritedComposed", "TxComposed"))); } @Test @@ -656,7 +654,7 @@ class MergedAnnotationsTests { @Test void getWithTypeHierarchyInheritedFromInterfaceMethod() throws Exception { Method method = ConcreteClassWithInheritedAnnotation.class.getMethod("handleFromInterface"); - MergedAnnotation annotation = MergedAnnotations.from(method,SearchStrategy.TYPE_HIERARCHY).get(Order.class); + MergedAnnotation annotation = MergedAnnotations.from(method, SearchStrategy.TYPE_HIERARCHY).get(Order.class); assertThat(annotation.isPresent()).isTrue(); assertThat(annotation.getAggregateIndex()).isEqualTo(1); } @@ -1129,7 +1127,7 @@ class MergedAnnotationsTests { @Test void getSuperClassSourceForTypesWithMultipleCandidateTypes() { - List> candidates = Arrays.asList(Transactional.class, Order.class); + List> candidates = List.of(Transactional.class, Order.class); // no class-level annotation assertThat(getSuperClassSourceWithTypeIn(NonAnnotatedInterface.class, candidates)).isNull();