MergeSort { public int[] transfer(int[] benefits) { int bLen = benefits.length; if (bLen < 2) throw new ArithmeticException("Need more than two numbers."); int[] transfer = new int[bLen - 1]; for (int i = 0; i < bLen - 1; i++) { transfer[i] = benefits[i + 1] - benefits[i]; } return transfer; }  int[] transfer(int[] benefits); int maxBenefit(int[] benefits, int low, int mid, int high); int findMaximum(int[] benefits, int low, int high);  }
@Test public void testTransfer() { int[] recoder = {100, 113, 110, 85, 105, 102, 86, 63, 81, 101, 94, 106, 101, 79, 94, 90, 97}; int[] transferred = mergeSort.transfer(recoder); StringBuilder strBuilder = new StringBuilder(); for (int t : transferred) strBuilder.append(t).append(" "); assertEquals("13 -3 -25 20 -3 -16 -23 18 20 -7 12 -5 -22 15 -4 7 ", strBuilder.toString()); }