public static <T> T last(List<T> elements) {
        int numberOfElements = elements.size();
        return elements.get(numberOfElements - 1);
    }
(*) Find the last element of a list.
<p>
Check P01Test class for test cases related to this problem.
java8/src/main/java/com/shekhargulati/ninetynine_problems/_01_lists/P01.java