Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Test
- public void testNegative() {
- int[] a = {-42, -2, -12};
- Queue<Integer>[] buckets = Solution.fillBuckets(a);
- // Check a has not been changed.
- Assert.assertEquals(-42, a[0]);
- Assert.assertEquals(-2, a[1]);
- Assert.assertEquals(-12, a[2]);
- // Check one bucket has been created
- Assert.assertEquals(41, buckets.length);
- Assert.assertEquals(new Integer(-42), buckets[0].poll());
- Assert.assertEquals(new Integer(-2), buckets[40].poll());
- Assert.assertEquals(new Integer(-12), buckets[30].poll());
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement