You need to get the max value from a collection of integers in Java. How would you do it?

## Solution

```
// Create a list of integers.
List<Integer> numbers = new ArrayList<>();
//Add a integers to the list.
numbers.add(5);
numbers.add(50);
numbers.add(500);
numbers.add(5000);
// Find the max value.
int max = Collections.max(numbers);
// Print the max value.
System.out.println("Max: " + max);
```