We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 02945d6 commit 31601baCopy full SHA for 31601ba
src/test/java/com/thealgorithms/datastructures/trees/BinaryTreeTest.java
@@ -45,7 +45,11 @@ class BinaryTreeTest {
45
"Tree should have 2 nodes left after removals.");
46
47
// Check if new root is correct
48
- Assertions.assertEquals(9, root.data);
+ if (root != null) {
49
+ Assertions.assertEquals(9, root.data);
50
+ } else {
51
+ Assertions.fail("Root is null after removals.");
52
+ }
53
}
54
55
// Test for attempting to remove a nonexistent node
0 commit comments