I have a very simple map
private Map<String,T> map = Collections.synchronizedSortedMap(new TreeMap<String,T>());
I would like to define the following method
public T[] values(){
return (T[])map.values().toArray();
}
And obviously, I'm ending up with an unchecked cast problem... My issue is I can't invoke toArray(new T[size])
.
What should I do to avoid this warning (wihtout using @SuppressedWarning)
Thanks