Restricted the sortByIndex and sortStableByIndex methods to package-scope.