Another way, you can use a pass-through object to capture the last value and then do something with it:
List<Integer> list = new ArrayList<Integer>();
Integer lastValue = null;
for (Integer i : list) {
// do stuff
lastValue = i;
}
// do stuff with last value