### Question:
Money implements ValueObject { public List<Money> split(int count){ if (getTotalFee() < count){ throw new IllegalArgumentException("total fee can not lt count"); } List<Money> result = Lists.newArrayList(); Long pre = getTotalFee() / count; for (int i=0; i< count; i++){ if (i == count-1){ Long fee = getTotalFee() - (pre * (count - 1)); result.add(Money.apply(fee, getFeeType())); }else { result.add(Money.apply(pre, getFeeType())); } } return result; } private  Money(); private  Money(Long totalFee, String feeType); static Money apply(Long totalFee); static Money apply(Long totalFee, String feeType); Money add(Money money); Money subtract(Money money); Money multiply(int var); List<Money> split(int count); static final String DEFAULT_FEE_TYPE; }### Answer:
@Test public void split() { Money m1 = Money.apply(100L); List<Money> monies = m1.split(33); Assert.assertEquals(33, monies.size()); monies.forEach(m -> Assert.assertEquals(m1.getFeeType(), m.getFeeType())); long total = monies.stream() .mapToLong(m->m.getTotalFee()) .sum(); Assert.assertEquals(100L, total); }