Here you can find the source of copyTypes(List
public static List<String> copyTypes(List<String> src, List<String> dest)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.Map; public class Main { public static List<String> copyTypes(List<String> src, List<String> dest) { if (isEmpty(src)) { if (dest != null) { dest.clear();// w w w .ja v a2 s. co m } } else { if (dest == null) { dest = new ArrayList<String>(src.size()); } else { dest.clear(); } dest.addAll(src); } return dest; } public static boolean isEmpty(Collection<?> coll) { return coll == null || coll.isEmpty(); } public static boolean isEmpty(Map<?, ?> map) { return map == null || map.isEmpty(); } }