Postgresql Get Last Element In Arraylist Syntax In Java