11package com .thealgorithms .datastructures .stacks ;
22
33import static org .junit .jupiter .api .Assertions .assertEquals ;
4- import static org .junit .jupiter .api .Assertions .assertFalse ;
54import static org .junit .jupiter .api .Assertions .assertThrows ;
65import static org .junit .jupiter .api .Assertions .assertTrue ;
76
@@ -70,7 +69,7 @@ void testIsEmpty() {
7069 NodeStack <Character > stack = new NodeStack <>();
7170 assertTrue (stack .isEmpty (), "Newly initialized stack should be empty." );
7271 stack .push ('A' );
73- assertFalse (stack .isEmpty (), "Stack should not be empty after a push operation." );
72+ org . junit . jupiter . api . Assertions . assertFalse (stack .isEmpty (), "Stack should not be empty after a push operation." );
7473 stack .pop ();
7574 assertTrue (stack .isEmpty (), "Stack should be empty after popping the only element." );
7675 }
@@ -132,7 +131,7 @@ void testPeekDoesNotModifyStack() {
132131 assertEquals (3 , peekedValue , "Peek should return top element" );
133132 assertEquals (originalSize , intStack .size (), "Peek should not change stack size" );
134133 assertEquals (3 , intStack .peek (), "Multiple peeks should return same value" );
135- assertFalse (intStack .isEmpty (), "Peek should not make stack empty" );
134+ org . junit . jupiter . api . Assertions . assertFalse (intStack .isEmpty (), "Peek should not make stack empty" );
136135 }
137136
138137 @ Test
@@ -214,7 +213,7 @@ void testStateConsistencyAfterExceptions() {
214213
215214 // Should be able to push after exceptions
216215 intStack .push (3 );
217- assertFalse (intStack .isEmpty ());
216+ org . junit . jupiter . api . Assertions . assertFalse (intStack .isEmpty ());
218217 assertEquals (1 , intStack .size ());
219218 assertEquals (3 , intStack .peek ());
220219 }
@@ -224,7 +223,7 @@ void testStateConsistencyAfterExceptions() {
224223 void testSingleElementStack () {
225224 intStack .push (2 );
226225
227- assertFalse (intStack .isEmpty (), "Stack with one element should not be empty" );
226+ org . junit . jupiter . api . Assertions . assertFalse (intStack .isEmpty (), "Stack with one element should not be empty" );
228227 assertEquals (1 , intStack .size (), "Size should be 1" );
229228 assertEquals (2 , intStack .peek (), "Peek should return the single element" );
230229 assertEquals (1 , intStack .size (), "Peek should not change size" );
0 commit comments