using System;
using System.Collections.Generic;
using System.Collections;
publicstaticclass CollectionUtils
{
publicstatic T[] ToArray<T>(this ICollection collection)
{
T[] res = new T[collection.Count];
int i = 0;
foreach (T elem in collection)
{
res[i] = elem;
i++;
}
return res;
}
}