Retrieve the last element of the given List, accessing the highest index.

@param list the List to check (may be {@code null} or empty)
@return the last element, or {@code null} if none
@since 5.0.3
481664
@Nullable
  public static <T> T lastElement(@Nullable final List<T> list) {
    if (CollectionUtils.isEmpty(list)) {
      return null;
    }
    return list.get(list.size() - 1);
  }
62963
E get(E key)
    {
        int idx = indexOf(key);
        if (idx >= 0)
        {
            return list.get(idx);
        }
        return null;
    }
292765
public long list(List<Map<String,Object>> list, Map<String,Object> search, int skip, int max){
        return 0;
    }
1078055
public static <T> T head(List<T> list)
	{
		if (list.isEmpty())
			return null;
		else
			return list.get(0);
	}
1351017
public static <T> T last(Iterator<T> iterator) {
		T result = null;
		while(iterator.hasNext()) {
			result = iterator.next();
		}
		return result;
	}
22188
public static <E extends Comparable<E>> E searchMax(List<E> list) {
        if(list.size() == 0) {
            throw new IllegalArgumentException("The list you provided does not have any elements");
        }
        E max = list.get(0);

        for(int i = 1; i < list.size(); i++) {
            if(list.get(i).compareTo(max) > 0 ) {
                max = list.get(i);
            }
        }
        return max;
    }
297373
public int lastIndexOf(Object o) {
		int index = -1;
		try {
			for (int i = 0; i < events.size(); i++) {
				if (events.get(i).equals(o)) {
					index = i;
				}
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
		return index;
	}
672885
void clear(int list) {
		int last = getLast(list);
		while (last != nullNode()) {
			int n = last;
			last = getPrev(n);
			freeNode_(n);
		}
		m_lists.setField(list, 0, -1);
		m_lists.setField(list, 1, -1);
		setListSize_(list, 0);
	}
341346
public static <T> T getLast(T[] objectArray)
    {
        if (ArrayIterate.notEmpty(objectArray))
        {
            return objectArray[objectArray.length - 1];
        }
        return null;
    }
710584
protected static Integer getSingleIntegerParam(List<String> list) {
        String s = getSingleParam(list);
        if (s != null) {
            try {
                return Integer.valueOf(s);
            } catch (NumberFormatException e) {
                return null;
            }
        }
        return null;
    }
157848
public static <E> E last(Iterable<E> iterable) {
        dbc.precondition(iterable != null, "cannot call last with a null iterable");
        return new LastElement<E>().apply(iterable.iterator());
    }
546622
public static <T extends Comparable<? super T>> ArrayList<T> sortThis(ArrayList<T> list)
    {
        return ArrayListIterate.sortThis(list, Comparators.naturalOrder());
    }
718070
public static <T> T getFirst(Collection<T> collection) {
		if (isEmpty(collection)) {
			return null;
		}
		if (collection instanceof List) {
			return ((List<T>) collection).get(0);
		}
		return collection.iterator().next();
	}
391430
public void addAll( List<T> list ) {
		if( list.isEmpty() )
			return;

		Element<T> a = requestNew();
		a.object = list.get(0);

		if( first == null ) {
			first = a;
		} else if( last != null ) {
			last.next = a;
			a.previous = last;
		}

		for (int i = 1; i < list.size(); i++) {
			Element<T> b = requestNew();
			b.object = list.get(i);

			a.next = b;
			b.previous = a;
			a = b;
		}

		last = a;
		size += list.size();
	}
109768
public PathElement getLastElement() {
        final List<PathElement> list = pathAddressList;
        return list.size() == 0 ? null : list.get(list.size() - 1);
    }
1371251
public static <T> T removeLast( List<T> list )
    {
        return remove( list, list.size() - 1 );
    }
732658
@Override
	public int lastIndexOf(long elem) {
		for (int i = size-1; i >= 0; i--)
			if (elem==elementData[i])
				return i;
		return -1;
	}