Advertisement
IvetValcheva

Test 8

Dec 8th, 2022
415
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.58 KB | None | 0 0
  1. import org.junit.Assert;
  2. import org.junit.Test;
  3.  
  4. import java.util.ArrayList;
  5. import java.util.List;
  6.  
  7. public class TestFloor1_shouldWorkCorrectly {
  8.  
  9.    @Test
  10.     public void testFloor1_shouldWorkCorrectly() {
  11.         BinarySearchTree<Integer> bst = new BinarySearchTree<>();
  12.  
  13.         bst.insert(12);
  14.         bst.insert(21);
  15.         bst.insert(5);
  16.         bst.insert(1);
  17.         bst.insert(8);
  18.         bst.insert(18);
  19.         bst.insert(23);
  20.  
  21.         Assert.assertEquals(7, bst.count());
  22.  
  23.         Integer floor = bst.floor(0);
  24.         Assert.assertNull(floor);
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement