else
{
// Get all values from the smallest upto val and put them into
// a list. They will be in ascending order so we need to reverse
// the list after adding val which is not included in headSet.
SortedSet headset = set.headSet( val );
ArrayList list = new ArrayList( set.size() + 1 );
list.addAll( headset );
// Add largest value (val) if it is in the set. TreeSet.headSet
// does not get val if val is in the set. So we add it now to