Here you can find the source of getLastElement(List
public static <T> T getLastElement(List<T> list)
//package com.java2s; //License from project: Open Source License import java.util.List; public class Main { public static <T> T getLastElement(List<T> list) { return list.get(list.size() - 1); }/*from www .j a v a 2s . c o m*/ }