Java Public Recipes
This creates a copy of the existing list and assigns the new list to newlist.
import java.util.List;
List newlist = List.copyOf(existingList);
This creates a copy of the existing list and assigns the new list to newlist.
import java.util.List;
List newlist = List.copyOf(existingList);