@Nullable
  public T getLastElement() {
    final List<T> elements = getElements();
    return (elements.isEmpty() ? null : elements.get(elements.size() - 1));
  }
@Nullable
  public T getLastElement()