mirror of
https://github.com/TheAlgorithms/Java.git
synced 2026-03-13 08:40:43 +08:00
* fix: revert ReverseStack deletions and ensure lint compliance * Fix formatting for ReverseStack and test files * Delete ReverseStackUsingRecursion and its test as requested --------- Co-authored-by: Deniz Altunkapan <93663085+DenizAltunkapan@users.noreply.github.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.thealgorithms.datastructures.stacks;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
import java.util.Stack;
|
||||
@@ -8,6 +9,11 @@ import org.junit.jupiter.api.Test;
|
||||
|
||||
class ReverseStackTest {
|
||||
|
||||
@Test
|
||||
void testReverseNullStack() {
|
||||
assertThrows(IllegalArgumentException.class, () -> ReverseStack.reverseStack(null), "Reversing a null stack should throw an IllegalArgumentException.");
|
||||
}
|
||||
|
||||
@Test
|
||||
void testReverseEmptyStack() {
|
||||
Stack<Integer> stack = new Stack<>();
|
||||
|
||||
Reference in New Issue
Block a user