Given a list of integers, sort all the values present in it using Stream functions?

This program sorts a list of integers in ascending order using Stream functions.

Code Example:

import java.util.*;
import java.util.stream.*;

public class SortValues {

    public static void main(String args[]) {

        List<Integer> myList = Arrays.asList(10, 15, 8, 49, 25, 98, 98, 32, 15);

        myList.stream()
                .sorted()
                .forEach(System.out::println);
    }
}

Output:

8 10 15 15 25 32 49 98 98