diff --git a/core-java-modules/core-java-collections-list-6/src/test/java/com/baeldung/addtoimmutablelist/AddElementsToImmutableListUnitTest.java b/core-java-modules/core-java-collections-list-6/src/test/java/com/baeldung/addtoimmutablelist/AddElementsToImmutableListUnitTest.java index f7ad690acb..13484b6dcb 100644 --- a/core-java-modules/core-java-collections-list-6/src/test/java/com/baeldung/addtoimmutablelist/AddElementsToImmutableListUnitTest.java +++ b/core-java-modules/core-java-collections-list-6/src/test/java/com/baeldung/addtoimmutablelist/AddElementsToImmutableListUnitTest.java @@ -16,6 +16,7 @@ public class AddElementsToImmutableListUnitTest { return List.copyOf(tmpList); } + @SafeVarargs public static List appendElements(List immutableList, T... elements) { List tmpList = new ArrayList<>(immutableList); tmpList.addAll(Arrays.asList(elements));