Java tutorial
//package com.java2s; import java.util.*; public class Main { public static <T> Collection<T> merge2copy(Collection<T> collection, T obj) { Collection<T> newCollection = new LinkedList<T>(collection); newCollection.add(obj); return newCollection; } }