public class StackTest extends junit.framework.TestCase { private Stack st; public StackTest(String testCaseName) { super(testCaseName); } public void setUp() { st = new Stack(10); } public void testEmptyAfterCreation() { assertTrue("Stack should be empty after creation.", st.isEmpty()); } public void testNonEmptyAfterPush() { st.push("something"); assertTrue("Stack should not be empty after push.", !st.isEmpty()); } public void testFullAfter10Pushes() { for(int i = 0; i < 10; i++) { st.push("something"); } assertTrue("Stack should be full after 10x push.", st.isFull()); } public void testLIFO() { st.push("something"); assertEquals("The last pushed value should be the first popped one.", "something", st.pop()); } public void tearDown() { } }