Java tutorial
import java.util.Arrays; import java.util.Comparator; import java.util.List; // sort is a default method // naturalOrder is a static method public class Main { public static void main(String... args) { List<Integer> numbers = Arrays.asList(3, 5, 1, 2, 6); numbers.sort(Comparator.naturalOrder()); System.out.println(numbers); } }