private static void _addFunctionMethod<T>(UniqueCollection<T> uniqueCollection, Collection<T> toAdd) { foreach (T item in toAdd) { uniqueCollection.Add(item); } }
private static void _test<T>(AddFunction<T> addFunction, Collection<T> toAdd) { UniqueCollection<T> uniqueCollection = new UniqueCollection<T>(); try { addFunction(uniqueCollection, toAdd); } catch (Exception e) { Console.WriteLine(e.Message); } finally { uniqueCollection.Print(); } }