@Test public void testSumByLong() { List<Long> list = new ArrayList<>(); list.add(0L); list.add(2L); list.add(3L); assertTrue(CollectionUtils.sumByLong(list) == 5); }
public static long sumByLong(Collection<Long> collection) { long sum = 0; for (long i : collection) { sum += i; } return sum; }
CollectionUtils { public static long sumByLong(Collection<Long> collection) { long sum = 0; for (long i : collection) { sum += i; } return sum; } }
CollectionUtils { public static long sumByLong(Collection<Long> collection) { long sum = 0; for (long i : collection) { sum += i; } return sum; }  }
CollectionUtils { public static long sumByLong(Collection<Long> collection) { long sum = 0; for (long i : collection) { sum += i; } return sum; }  static boolean isEmpty(final Collection<?> collection); static boolean isNotEmpty(final Collection<?> collection); static Map<K, List<V>> groupingBy(final Collection<V> collection, Function<? super V, ? extends K> keyMapper); static PairMap<L, R, List<V>> groupingBy(final Collection<V> collection, Function<? super V, ? extends L> leftMapper, Function<? super V, ? extends R> rightMapper); static Optional<V> matching(final Collection<V> collection, Function<V, ? extends Long> keyMapper, long value); static Optional<V> matching(final Collection<V> collection, Function<V, ? extends Integer> keyMapper, int value); static int sumByInt(Collection<Integer> collection); static long sumByLong(Collection<Long> collection); }
CollectionUtils { public static long sumByLong(Collection<Long> collection) { long sum = 0; for (long i : collection) { sum += i; } return sum; }  static boolean isEmpty(final Collection<?> collection); static boolean isNotEmpty(final Collection<?> collection); static Map<K, List<V>> groupingBy(final Collection<V> collection, Function<? super V, ? extends K> keyMapper); static PairMap<L, R, List<V>> groupingBy(final Collection<V> collection, Function<? super V, ? extends L> leftMapper, Function<? super V, ? extends R> rightMapper); static Optional<V> matching(final Collection<V> collection, Function<V, ? extends Long> keyMapper, long value); static Optional<V> matching(final Collection<V> collection, Function<V, ? extends Integer> keyMapper, int value); static int sumByInt(Collection<Integer> collection); static long sumByLong(Collection<Long> collection);  }