private void moveNewToOld() {
   while (!newStack.isEmpty()) oldStack.push(newStack.pop());
 }
 public T remove() {
   if (isEmpty()) throw new NoSuchElementException();
   if (oldStack.isEmpty()) moveNewToOld();
   return oldStack.pop();
 }