MathUtils { public static int sumSizes(int[] sizes){ if (sizes == null){ throw new OptimizationException("array of sizes cannot be null"); } return sumSizes(sizes, sizes.length); }  static int sumSizes(int[] sizes); static int sumSizes(int[] sizes, int maxIndexExclusive);  }
@Test public void testSumSizes1() throws Exception { int[] sizes = new int[]{2, 5, 7, 9, 3}; int sum = MathUtils.sumSizes(sizes); Assert.assertTrue(sum == (2 + 5 + 7 + 9 + 3)); }
@Test public void testSumSizes2() throws Exception { int[] sizes = new int[]{2, 5, 7, 9, 3}; int sum = MathUtils.sumSizes(sizes, 2); Assert.assertTrue(sum == (2 + 5)); }