@Test public void testPop() { stacks.push(1); stacks.push(2); int e = stacks.pop(); assertEquals(2, e); assertEquals(1, stacks.size()); assertEquals(1, stacks.numElements()); }
public E pop() { final E element = stacks.getFirst().remove(); if (stacks.getFirst().isEmpty() && stacks.size() != 1) { stacks.remove(); } return element; }
SetOfStacks { public E pop() { final E element = stacks.getFirst().remove(); if (stacks.getFirst().isEmpty() && stacks.size() != 1) { stacks.remove(); } return element; } }
SetOfStacks { public E pop() { final E element = stacks.getFirst().remove(); if (stacks.getFirst().isEmpty() && stacks.size() != 1) { stacks.remove(); } return element; } SetOfStacks();  SetOfStacks(int capacity); }
SetOfStacks { public E pop() { final E element = stacks.getFirst().remove(); if (stacks.getFirst().isEmpty() && stacks.size() != 1) { stacks.remove(); } return element; } SetOfStacks();  SetOfStacks(int capacity); E push(E element); E pop(); E peek(); boolean isEmpty(); int size(); int numElements(); }
SetOfStacks { public E pop() { final E element = stacks.getFirst().remove(); if (stacks.getFirst().isEmpty() && stacks.size() != 1) { stacks.remove(); } return element; } SetOfStacks();  SetOfStacks(int capacity); E push(E element); E pop(); E peek(); boolean isEmpty(); int size(); int numElements();  }