@Test public void testMinimalPositive() { assertEquals(BigDecimal.ZERO, MoneyUtils.minPositive(null, null)); assertEquals(BigDecimal.ZERO, MoneyUtils.minPositive(BigDecimal.ZERO, BigDecimal.ZERO)); assertEquals(BigDecimal.ONE, MoneyUtils.minPositive(BigDecimal.ONE, null)); assertEquals(BigDecimal.ONE, MoneyUtils.minPositive(BigDecimal.ONE, BigDecimal.ZERO)); assertEquals(BigDecimal.ONE, MoneyUtils.minPositive(null, BigDecimal.ONE)); assertEquals(BigDecimal.ONE, MoneyUtils.minPositive(BigDecimal.ZERO, BigDecimal.ONE)); assertEquals(BigDecimal.ONE, MoneyUtils.minPositive(BigDecimal.TEN, BigDecimal.ONE)); assertEquals(BigDecimal.ONE, MoneyUtils.minPositive(BigDecimal.ONE, BigDecimal.TEN)); assertEquals(BigDecimal.ZERO, MoneyUtils.minPositive(new Pair<>(null, null))); assertEquals(BigDecimal.ZERO, MoneyUtils.minPositive(new Pair<>(BigDecimal.ZERO, BigDecimal.ZERO))); assertEquals(BigDecimal.ONE, MoneyUtils.minPositive(new Pair<>(BigDecimal.ONE, null))); assertEquals(BigDecimal.ONE, MoneyUtils.minPositive(new Pair<>(BigDecimal.ONE, BigDecimal.ZERO))); assertEquals(BigDecimal.ONE, MoneyUtils.minPositive(new Pair<>(null, BigDecimal.ONE))); assertEquals(BigDecimal.ONE, MoneyUtils.minPositive(new Pair<>(BigDecimal.ZERO, BigDecimal.ONE))); assertEquals(BigDecimal.ONE, MoneyUtils.minPositive(new Pair<>(BigDecimal.TEN, BigDecimal.ONE))); assertEquals(BigDecimal.ONE, MoneyUtils.minPositive(new Pair<>(BigDecimal.ONE, BigDecimal.TEN))); }
public static BigDecimal minPositive(final Pair<BigDecimal, BigDecimal> firstAndSecond) { return minPositive(firstAndSecond.getSecond(), firstAndSecond.getFirst()); }
MoneyUtils { public static BigDecimal minPositive(final Pair<BigDecimal, BigDecimal> firstAndSecond) { return minPositive(firstAndSecond.getSecond(), firstAndSecond.getFirst()); } }
MoneyUtils { public static BigDecimal minPositive(final Pair<BigDecimal, BigDecimal> firstAndSecond) { return minPositive(firstAndSecond.getSecond(), firstAndSecond.getFirst()); } private  MoneyUtils(); }
MoneyUtils { public static BigDecimal minPositive(final Pair<BigDecimal, BigDecimal> firstAndSecond) { return minPositive(firstAndSecond.getSecond(), firstAndSecond.getFirst()); } private  MoneyUtils(); static BigDecimal max(final BigDecimal first, final BigDecimal second); static BigDecimal secondOrFirst(final Pair<BigDecimal, BigDecimal> firstAndSecond); static BigDecimal minPositive(final Pair<BigDecimal, BigDecimal> firstAndSecond); static BigDecimal minPositive(final BigDecimal first, final BigDecimal second); static BigDecimal notNull(final BigDecimal value); static BigDecimal notNull(final BigDecimal value, final BigDecimal ifNull); static boolean isPositive(final BigDecimal value); static boolean isFirstBiggerThanSecond(final BigDecimal first, final BigDecimal second); static boolean isFirstBiggerThanOrEqualToSecond(final BigDecimal first, final BigDecimal second); static boolean isFirstEqualToSecond(final BigDecimal first, final BigDecimal second); static boolean isFirstEqualToSecond(final BigDecimal first, final BigDecimal second, final int scale); static BigDecimal getDiscountDisplayValue(final BigDecimal original, final BigDecimal discounted); static Money getMoney(final BigDecimal money, final BigDecimal taxRate, final boolean taxIncluded); static BigDecimal getTaxAmount(final BigDecimal money, final BigDecimal taxRate, final boolean taxIncluded); static BigDecimal getNetAmount(final BigDecimal money, final BigDecimal taxRate, final boolean taxIncluded); static BigDecimal getGrossAmount(final BigDecimal money, final BigDecimal taxRate, final boolean taxIncluded); }
MoneyUtils { public static BigDecimal minPositive(final Pair<BigDecimal, BigDecimal> firstAndSecond) { return minPositive(firstAndSecond.getSecond(), firstAndSecond.getFirst()); } private  MoneyUtils(); static BigDecimal max(final BigDecimal first, final BigDecimal second); static BigDecimal secondOrFirst(final Pair<BigDecimal, BigDecimal> firstAndSecond); static BigDecimal minPositive(final Pair<BigDecimal, BigDecimal> firstAndSecond); static BigDecimal minPositive(final BigDecimal first, final BigDecimal second); static BigDecimal notNull(final BigDecimal value); static BigDecimal notNull(final BigDecimal value, final BigDecimal ifNull); static boolean isPositive(final BigDecimal value); static boolean isFirstBiggerThanSecond(final BigDecimal first, final BigDecimal second); static boolean isFirstBiggerThanOrEqualToSecond(final BigDecimal first, final BigDecimal second); static boolean isFirstEqualToSecond(final BigDecimal first, final BigDecimal second); static boolean isFirstEqualToSecond(final BigDecimal first, final BigDecimal second, final int scale); static BigDecimal getDiscountDisplayValue(final BigDecimal original, final BigDecimal discounted); static Money getMoney(final BigDecimal money, final BigDecimal taxRate, final boolean taxIncluded); static BigDecimal getTaxAmount(final BigDecimal money, final BigDecimal taxRate, final boolean taxIncluded); static BigDecimal getNetAmount(final BigDecimal money, final BigDecimal taxRate, final boolean taxIncluded); static BigDecimal getGrossAmount(final BigDecimal money, final BigDecimal taxRate, final boolean taxIncluded); static final BigDecimal ZERO; static final BigDecimal ONE; static final BigDecimal HUNDRED; }