diff --git a/test-framework/common/src/main/java/io/quarkus/test/common/TestResourceManager.java b/test-framework/common/src/main/java/io/quarkus/test/common/TestResourceManager.java index 3d1c01fe7d2db..9a6d338a29f70 100644 --- a/test-framework/common/src/main/java/io/quarkus/test/common/TestResourceManager.java +++ b/test-framework/common/src/main/java/io/quarkus/test/common/TestResourceManager.java @@ -433,12 +433,10 @@ private Collection findQuarkusTestResourceInstances(Class current = current.getEnclosingClass(); } - Set testResourceAnnotations = new LinkedHashSet<>(); - - Stream.of(WITH_TEST_RESOURCE, QUARKUS_TEST_RESOURCE) + Set testResourceAnnotations = Stream.of(WITH_TEST_RESOURCE, QUARKUS_TEST_RESOURCE) .flatMap(dotName -> index.getAnnotations(dotName).stream()) .filter(annotation -> keepTestResourceAnnotation(annotation, annotation.target().asClass(), testClasses)) - .forEach(testResourceAnnotations::add); + .collect(Collectors.toCollection(LinkedHashSet::new)); Stream.of(WithTestResource.List.class.getName(), QuarkusTestResource.List.class.getName()) .map(DotName::createSimple)