From 356624bf222f79648cc4e0a74fca727150c6dc56 Mon Sep 17 00:00:00 2001 From: "Kai.Yuan" Date: Tue, 19 Mar 2024 23:54:56 +0100 Subject: [PATCH] [add-to-immutable-list] add elements to immutable list --- .../addtoimmutablelist/AddElementsToImmutableListUnitTest.java | 1 + 1 file changed, 1 insertion(+) 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));