How do I return a TreeSet of the values contained in a TreeMap?

Viewed 285

I am trying to get a set of all the values for keys in a TreeMap that are greater than some value, key.

Code attempt below:

TreeSet<E> set = (TreeSet<E>)tMap.tailMap(key, false).values();

Is there a way to do this in Java?

Thanks!!

1 Answers
Related