@Test public void acceptTest() { GroupMonetarySummaryStatistics group = new GroupMonetarySummaryStatistics(); group.accept(Money.of(10, BRAZILIAN_REAL)); group.accept(Money.of(20, BRAZILIAN_REAL)); Map<CurrencyUnit, MonetarySummaryStatistics> map = group.get(); Assert.assertEquals(map.keySet().size(), 1); }
public GroupMonetarySummaryStatistics accept(MonetaryAmount amount) { CurrencyUnit currency = Objects.requireNonNull(amount).getCurrency(); groupSummary.putIfAbsent(currency, new DefaultMonetarySummaryStatistics( currency)); MonetarySummaryStatistics summary = groupSummary.get(currency); summary.accept(amount); return this; }
GroupMonetarySummaryStatistics { public GroupMonetarySummaryStatistics accept(MonetaryAmount amount) { CurrencyUnit currency = Objects.requireNonNull(amount).getCurrency(); groupSummary.putIfAbsent(currency, new DefaultMonetarySummaryStatistics( currency)); MonetarySummaryStatistics summary = groupSummary.get(currency); summary.accept(amount); return this; } }
GroupMonetarySummaryStatistics { public GroupMonetarySummaryStatistics accept(MonetaryAmount amount) { CurrencyUnit currency = Objects.requireNonNull(amount).getCurrency(); groupSummary.putIfAbsent(currency, new DefaultMonetarySummaryStatistics( currency)); MonetarySummaryStatistics summary = groupSummary.get(currency); summary.accept(amount); return this; } GroupMonetarySummaryStatistics(); }
GroupMonetarySummaryStatistics { public GroupMonetarySummaryStatistics accept(MonetaryAmount amount) { CurrencyUnit currency = Objects.requireNonNull(amount).getCurrency(); groupSummary.putIfAbsent(currency, new DefaultMonetarySummaryStatistics( currency)); MonetarySummaryStatistics summary = groupSummary.get(currency); summary.accept(amount); return this; } GroupMonetarySummaryStatistics(); Map<CurrencyUnit, MonetarySummaryStatistics> get(); GroupMonetarySummaryStatistics accept(MonetaryAmount amount); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); GroupMonetarySummaryStatistics combine(
            GroupMonetarySummaryStatistics another); }
GroupMonetarySummaryStatistics { public GroupMonetarySummaryStatistics accept(MonetaryAmount amount) { CurrencyUnit currency = Objects.requireNonNull(amount).getCurrency(); groupSummary.putIfAbsent(currency, new DefaultMonetarySummaryStatistics( currency)); MonetarySummaryStatistics summary = groupSummary.get(currency); summary.accept(amount); return this; } GroupMonetarySummaryStatistics(); Map<CurrencyUnit, MonetarySummaryStatistics> get(); GroupMonetarySummaryStatistics accept(MonetaryAmount amount); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); GroupMonetarySummaryStatistics combine(
            GroupMonetarySummaryStatistics another);  }