[add-to-immutable-list] add elements to immutable list
This commit is contained in:
parent
e959114bc7
commit
356624bf22
|
@ -16,6 +16,7 @@ public class AddElementsToImmutableListUnitTest {
|
|||
return List.copyOf(tmpList);
|
||||
}
|
||||
|
||||
@SafeVarargs
|
||||
public static <T> List<T> appendElements(List<T> immutableList, T... elements) {
|
||||
List<T> tmpList = new ArrayList<>(immutableList);
|
||||
tmpList.addAll(Arrays.asList(elements));
|
||||
|
|
Loading…
Reference in New Issue