private static int[] sortedIndexes(double[] probabilities) {
        return IntStream.range(0, probabilities.length)
                .boxed()
                .sorted((index1, index2) -> -Doubles.compare(probabilities[index1], probabilities[index2]))
                .mapToInt(index -> index)
                .toArray();
    }
Create and sort array of indexes according highest probabilities.

@param probabilities array of probability
@return sorted array of indexes (highest probability index first)
java/api/src/main/java/com/exadel/frs/core/trainservice/component/classifiers/EuclideanDistanceClassifier.java