[java] How to get the last value of an ArrayList