/** * Copy the content of the set into an array. * @param dest the destination array. * @throws NullPointerException if <code>dest</code> is <code>null</code>. * @throws ArrayIndexOutOfBoundsException if there is not enough * space after <code>offset</code> in the destination array to hold all values in the set. */ public void copyTo(final int[] dest) { copyTo(dest,0); }
@Test public void testCopyTo() { final CountSet subject = new CountSet(10); subject.addAll(1,4,7); final int[] intArray = new int[3]; subject.copyTo(intArray); Assert.assertEquals(intArray[0],1); Assert.assertEquals(intArray[1],4); Assert.assertEquals(intArray[2],7); }