@Test public void testSumDouble() { List<Double> linkedList = new LinkedList<>(); Double doubleValue = new Double(2832); linkedList.add(doubleValue); Double result = SumHelper.sumDouble(linkedList); assertTrue(linkedList.contains(result)); assertEquals(result, doubleValue, 0.01); assertEquals(2832.0, result, 0.01); assertEquals(1, linkedList.size()); }
public static Double sumDouble(Collection<Double> input) { Double sum = (double) 0; for (Double x : input) { sum += x; } return sum; }
SumHelper { public static Double sumDouble(Collection<Double> input) { Double sum = (double) 0; for (Double x : input) { sum += x; } return sum; } }
SumHelper { public static Double sumDouble(Collection<Double> input) { Double sum = (double) 0; for (Double x : input) { sum += x; } return sum; }  }
SumHelper { public static Double sumDouble(Collection<Double> input) { Double sum = (double) 0; for (Double 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 Double sumDouble(Collection<Double> input) { Double sum = (double) 0; for (Double x : input) { sum += x; } return sum; }  static Long sumLong(Collection<Long> input); static Long sumInteger(Collection<Integer> input); static Double sumDouble(Collection<Double> input);  }