class MoneyUtils {

    public static Money getMoney(final BigDecimal money, final BigDecimal taxRate, final boolean taxIncluded) {
        if (money == null) {
            return new Money(Total.ZERO, Total.ZERO, Total.ZERO, Total.ZERO, taxRate, taxIncluded);
        }

        final BigDecimal tax = getTaxAmount(money, taxRate, taxIncluded);

        if (taxIncluded) {

            return new Money(money, money.subtract(tax), money, tax, taxRate, taxIncluded);
        }

        return new Money(money, money, money.add(tax), tax, taxRate, taxIncluded);
    }

    private  MoneyUtils();

}