Java tutorial
//package com.java2s; //License from project: Apache License import java.util.*; public class Main { private static <T> List<T> copyList(List<T> original) { List<T> copy = null; if (original != null) { copy = new ArrayList<T>(); if (!original.isEmpty()) { copy.addAll(original); } } return copy; } }