@Override
    public T pop() {
        if (firstElement == null) {
            return null;
        }
        T value = firstElement.value;
        firstElement = firstElement.getNext();
        return value;
    }