question: private void ensureSortedByIndex ( ) { if ( currentSortOrder != SORT_ORDER_BY_INDEX ) { Collections . sort ( samples , INDEX_COMPARATOR ) ; currentSortOrder = SORT_ORDER_BY_INDEX ; } }
target:  Sort the samples by index, if not already.