question: public int [ ] toSortedModelIndices ( int [ ] unsortedModelIndices ) { int [ ] sortedModelIndices = new int [ unsortedModelIndices . length ] ; int x = 0 ; for ( int unsortedIndex : unsortedModelIndices ) { sortedModelIndices [ x ++ ] = toSortedModelIndex ( unsortedIndex ) ; } Arrays . sort ( sortedModelIndices ) ; return sortedModelIndices ; }
target:  Convert an array of unsorted model selection indices to  indices in the sorted model. Sort the model indices from  low to high to duplicate JList's getSelectedIndices method