sum static method

Money sum(
  1. Iterable<Money> amounts
)

Implementation

static Money sum(Iterable<Money> amounts)
{
  int total = 0;
  for (Money amount in amounts)
  {
    total += amount.value;
  }
  return new Money(total);
}