Removes the object at the top of this stack and returns that object as the
value of this function.

@return The object at the top of this stack (the last item of the
<tt>ArrayList</tt> object).
@exception EmptyStackException if this stack is empty.
354225
public E pop() {
    E obj;
    int len = size();
    obj = peek();
    remove(len - 1);
    return obj;
  }
1198963
public T allocate()
  {
    T value = _freeRing.allocate();
    
    if (value != null) {
      return value;
    }
    
    return _freeRingSoft.allocate();
  }
282795
public ObjectSinkNode removeLast() {
        if ( this.lastNode == null ) {
            return null;
        }
        final ObjectSinkNode node = this.lastNode;
        this.lastNode = node.getPreviousObjectSinkNode();
        node.setPreviousObjectSinkNode( null );
        if ( this.lastNode != null ) {
            this.lastNode.setNextObjectSinkNode( null );
        } else {
            this.firstNode = this.lastNode;
        }
        this.size--;
        return node;
    }
1070970
public T removeLast() {
        if ( this.lastNode == null ) {
            return null;
        }
        final T node = this.lastNode;
        this.lastNode = node.getPrevious();
        node.setPrevious( null );
        if ( this.lastNode != null ) {
            this.lastNode.setNext( null );
        } else {
            this.firstNode = null;
        }
        this.size--;
        return node;
    }
1374877
public final Node popAndTop()
  {

    m_firstFree--;

    m_map[m_firstFree] = null;

    return (m_firstFree == 0) ? null : m_map[m_firstFree - 1];
  }
149194
public Object previous() {
        Object element = null;
        if (previousElement != null) {
            element = previousElement;
            previousElement = null;
        } else {
            element = getPreviousElement();
            if (element == null) {
                throw new java.util.NoSuchElementException();
            }
        }
        return element;
    }
640054
private <T> Iterator<T> emptyIt() {
        return new Iterator<T>() {
            @Override
            public boolean hasNext() {
                return false;
            }
            @Override
            public T next() {
                return null;
            }
        };
    }
792105
public final int popAndTop()
  {

    m_firstFree--;

    m_map[m_firstFree] = DTM.NULL;

    return (m_firstFree == 0) ? DTM.NULL : m_map[m_firstFree - 1];
  }
220449
public Val nextValue() throws IOException {
      switch (peek()) {
         case BEGIN_ARRAY:
            return Val.of(nextCollection(ArrayList::new));
         case BEGIN_OBJECT:
            return Val.of(nextMap());
         case NAME:
            return nextKeyValue().getV2();
         default:
            return nextSimpleValue();
      }
   }
1321182
@Override
  public V remove(Object o) {
    checkMutable();
    @SuppressWarnings("unchecked")
    final K key = (K) o;
    final int index = binarySearchInArray(key);
    if (index >= 0) {
      return removeArrayEntryAt(index);
    }
    // overflowEntries might be Collections.unmodifiableMap(), so only
    // call remove() if it is non-empty.
    if (overflowEntries.isEmpty()) {
      return null;
    } else {
      return overflowEntries.remove(key);
    }
  }
1314087
synchronized public E get() {
		if (this.isClosed())
			throw new NoSuchElementException();

		while (this.elements.isEmpty()) {
			try {
				this.wait();
			} catch (final InterruptedException e) {
				Thread.currentThread().interrupt();
				throw new RuntimeException(e);
			}
		}
		return this.elements.remove();
	}
1352566
def pop(self):
        

        if self.stack:
            val = self.stack[0]
            self.stack = self.stack[1:]
            return val
        else:
            raise StackError('Stack empty')
1280111
@Override
    public void dup()
    {
        if (top < 1)
        {
            throw new EmptyStackException();
        }
        if (top >= stack.length)
        {
            stack = Arrays.copyOf(stack, (int) (stack.length*growFactor));
        }
        top++;
        stack[top-1] = stack[top-2];
    }
1336730
public JsonWriter endObject() {
        if (!context.map()) {
            throw new IllegalStateException("Unexpected end, not in object.");
        }
        if (context.value()) {
            throw new IllegalStateException("Expected map value but got end.");
        }
        writer.write('}');
        context = stack.pop();
        return this;
    }
1162446
function getCurrentStackItem() {
		$topItem = end($this->statements);

		if (!empty($topItem)) {
			return $topItem;
		} else {
			// In case of a empty stack, we are at the root of a PHP file (with no class or function).
			// We return the default values
			return $this->getDefaultItem();
		}
	}
189900
public boolean free(T obj)
  {
    AtomicInteger topRef = _top;

    while (true) {
      final int top = topRef.get();
      
      if (_capacity <= top) {
        return false;
      }

      boolean isFree = _freeStack.compareAndSet(top, null, obj);
      
      topRef.compareAndSet(top, top + 1);

      if (isFree) {
        return true;
      }
    }
  }
299246
public <V> V getValue() {
        if (values == null || values.isEmpty()) {
            return null;
        }
        return (V)values.get(0);
    }