StoreCredit { static <E extends Comparable<E>> void mergeSort(List<E> inputs) { int size = (int)(inputs.size() / ((double) 2)); ArrayDeque<E> left = new ArrayDeque<E>(size); ArrayDeque<E> right = new ArrayDeque<E>(size); mergeSort(inputs, 0, inputs.size() - 1, left, right); }    }
@Test public void testMergeSort() { String line = "9 10 1 2 56 4 5 11 3"; List<Integer> sorted = Arrays.asList(1, 2, 3, 4, 5, 9, 10, 11, 56); List<Integer> output = StoreCredit.lineToSortedInts(line); assertArrayEquals(sorted.toArray(), output.toArray()); }