One list with names:(unsorted) e.g [paul, foul, mark]
Another list with integers: e.g [5, 2, 6]
The values on the secon
Build a list of pairs of (name, value) by taking elements from the two lists pairwise (having a class that stores the two values as fields). Implement Comparable to compare the value field.
Sort the result with Collections.sort().
Collections.sort()
Extract the names from the sorted list.