Stack { public void clear() { mSize = 0; mElements.clear(); } Stack(); void push(E ele); E pop(); E peek(); E get(int index); E set(int index, E value); E remove(int index); int size(); boolean isEmpty(); void clear();  }
@Test public void testClear() throws Exception { Stack<String> stack = new Stack<String>(); stack.push("one"); stack.push("two"); assertThat(stack.isEmpty(), is(false)); stack.clear(); assertThat(stack.isEmpty(), is(true)); }