Advertisement
Guest User

Untitled

a guest
Mar 30th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. @Test
  2. public void testNegative() {
  3. int[] a = {-42, -2, -12};
  4. Queue<Integer>[] buckets = Solution.fillBuckets(a);
  5.  
  6. // Check a has not been changed.
  7. Assert.assertEquals(-42, a[0]);
  8. Assert.assertEquals(-2, a[1]);
  9. Assert.assertEquals(-12, a[2]);
  10.  
  11. // Check one bucket has been created
  12. Assert.assertEquals(41, buckets.length);
  13. Assert.assertEquals(new Integer(-42), buckets[0].poll());
  14. Assert.assertEquals(new Integer(-2), buckets[40].poll());
  15. Assert.assertEquals(new Integer(-12), buckets[30].poll());
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement