IntegerStack { public synchronized Integer push(Integer x) { if (++index == data.length) { grow(); } data[index] = x; return x; }  synchronized Integer push(Integer x); synchronized Integer pop(); synchronized Integer peek(); synchronized void clear(); int size(); static final int CHUNK_SIZE; static final int CLEAR_SIZE; }
@Test public void push() { stk.push(1); stk.push(2); stk.push(Integer.MAX_VALUE); assertEquals(3, stk.size()); }