I would like to sort a list of strings with an array of integers as the new indexes:
Integer[] newIndexes = {0,2,1};
List<String> fruits = new ArrayList<>();
fruits.add("Apple");
fruits.add("Pear");
fruits.add("Banana");
fruits.sort....
What would be the best way to do this?
TreeMap<Integer, String>, put index and string and then get the values sorted by index.