for ( int i = 0; i < keys.length; i++ ) {
vals[i] = keys[i] * 2;
map.put( keys[i], vals[i] );
}
TIntSet set = map.keySet();
int[] sorted_keys = new int[ keys.length ];
System.arraycopy( keys, 0, sorted_keys, 0, keys.length );
Arrays.sort( sorted_keys );
int[] setarray = set.toArray();
Arrays.sort( setarray );