Java Unit Testing
<p>I have a program and I am trying to write my Unit Test for it, I just need to know if it is correct? Here is the program: </p>

<pre><code>public static int[] bucketSort(int[] entries)
    {
        int numberBuckets = maxVal(entries);
        //Creates an array with maxVal buckets. 
        int[] buckets = new int[numberBuckets+1];
        //Loop through input entries and add one to the count for every occurrence of that number in entries.
        for (int i = 0; i &lt; entries.length; i++)
        {
            buckets[entries[i]]++; 
        }
           int key = 0;
           for (int i = 0; i &lt; buckets.length; i++)
           {
            for (int j = 0; j &lt; buckets[i]; j++)
            {
                //Use the number of every occurrence of each number in entries to construct the sorted array.
                entries[key] = i;
                key++;
            }
           } 
           //Print out the sorted array.
            for(int i = 0; i &lt;= entries.length-1; i++)
            {
                System.out.print(entries[i] + ", ");
            }
           return entries;
    }
</code></pre>

<p>Here is what I have for the Unit Test</p>

<pre><code>import junit.framework.Assert;
import junit.framework.TestCase;

        public void testBucketSort()
        {
            int[] a1 = {9, 6, 2, 2, 4, 1, 0, 10,};
            int[] a2 = BucketSort.bucketSort(a);
            int[] a3 = {0, 1, 2, 2, 4, 6, 9, 10,};
            Assert.assertArrayEquals(a2, a3);
        }
    }
</code></pre>
