pop() and hasElements(List<T>) completed