Java Utililty Methods List Clone

List of utility methods to do List Clone

Description

The list of methods to do List Clone are organized into topic(s).

Method

ListcloneStringList(List list)
Clone the specified List.
if (list == null)
    return null;
List<String> cloneList = new ArrayList<String>();
for (String value : list)
    cloneList.add(value);
return cloneList;
ListcloneStringList(List toClone)
Method to clone a specific list.
List<String> result = new ArrayList<String>();
for (String s : toClone) {
    result.add(new String(s));
return result;
ListcloneToList(final Collection list)
for defensive copying
if (list == null) {
    return null;
return new ArrayList<E>(list);
List>getClone(List> lls)
get Clone
if (lls == null) {
    return (lls);
List<List<String>> result = new ArrayList<List<String>>(lls.size());
for (List<String> l : lls) {
    result.add(new ArrayList<String>(l));
return (result);
...
ListgetClonedSublistOf(List list, int startIndexInclusive, int endIndexExclusive)
get Cloned Sublist Of
List<String> subList = new ArrayList<String>();
for (int i = startIndexInclusive; i < endIndexExclusive; ++i)
    subList.add(list.get(i));
return subList;