code: public static <T> T removeLast(List<T> self) {
          if (self.isEmpty()) {
              throw new NoSuchElementException("Cannot removeLast() an empty List");
          }
          return self.remove(self.size() - 1);
      }
docs: Removes the last item from the List.
  
  <pre class="groovyTestCase">
  def list = ["a", false, 2]
  assert list.removeLast() == 2
  assert list == ["a", false]
  </pre>
  
  Using add() and removeLast() is similar to push and pop on a Stack
  where the last item in the list represents the top of the stack.
  
  @param self a List
  @return the item removed from the List
  @throws NoSuchElementException if the list is empty
  @since 2.5.0