@Test public void testSumIntegerReturningLongWhereShortValueIsPositive() { List<Integer> linkedList = new LinkedList<>(); Integer integer = Integer.valueOf(4584); linkedList.add(integer); Long result = SumHelper.sumInteger(linkedList); assertTrue(linkedList.contains(integer)); assertNotNull(result); assertEquals(4584L, (long) result); assertEquals(1, linkedList.size()); }
public static Long sumInteger(Collection<Integer> input) { Long sum = 0L; for (Integer x : input) { sum += x; } return sum; }
SumHelper { public static Long sumInteger(Collection<Integer> input) { Long sum = 0L; for (Integer x : input) { sum += x; } return sum; } }
SumHelper { public static Long sumInteger(Collection<Integer> input) { Long sum = 0L; for (Integer x : input) { sum += x; } return sum; }  }
SumHelper { public static Long sumInteger(Collection<Integer> input) { Long sum = 0L; for (Integer x : input) { sum += x; } return sum; }  static Long sumLong(Collection<Long> input); static Long sumInteger(Collection<Integer> input); static Double sumDouble(Collection<Double> input); }
SumHelper { public static Long sumInteger(Collection<Integer> input) { Long sum = 0L; for (Integer x : input) { sum += x; } return sum; }  static Long sumLong(Collection<Long> input); static Long sumInteger(Collection<Integer> input); static Double sumDouble(Collection<Double> input);  }