int[] arr2 = new int[] {54, 432, 53, 21, 43}; int[] answer = Arrays.stream(arr2).boxed() .sorted(Comparator.comparing(Integer::intValue).reversed()) .mapToInt(Integer::intValue) .toArray()