@Test void size() { FixedStack<String> stack = new FixedStack<>(2); Assertions.assertEquals(0, stack.size()); stack.push("element"); Assertions.assertEquals(1, stack.size()); stack.pop(); Assertions.assertEquals(0, stack.size()); }
@Override public int size() { return index; }
FixedStack implements IStack<T> { @Override public int size() { return index; } }
FixedStack implements IStack<T> { @Override public int size() { return index; } @SuppressWarnings("unchecked")  FixedStack(int size); }
FixedStack implements IStack<T> { @Override public int size() { return index; } @SuppressWarnings("unchecked")  FixedStack(int size); @Override void push(T element); @Override T peek(); @Override T pop(); @Override int size(); @Override boolean isEmpty(); @Override void clear(); @Override final T[] toArray(Class<T[]> arrayType); }
FixedStack implements IStack<T> { @Override public int size() { return index; } @SuppressWarnings("unchecked")  FixedStack(int size); @Override void push(T element); @Override T peek(); @Override T pop(); @Override int size(); @Override boolean isEmpty(); @Override void clear(); @Override final T[] toArray(Class<T[]> arrayType);  }