package com.akikanellis.kata01.price;

import java.math.BigDecimal;
import java.util.Objects;

import static com.akikanellis.kata01.utils.Preconditions.checkNotNegative;
import static com.akikanellis.kata01.utils.Preconditions.checkNotNull;

public final class Price {
    public static final Price ZERO = Price.of(BigDecimal.ZERO);
    public static final Price ONE = Price.of(BigDecimal.ONE);

    private final BigDecimal amount;

    private Price(BigDecimal amount) {
        this.amount = checkNotNull(amount);
    }

    public static Price of(long amount) {
        BigDecimal bigDecimalAmount = BigDecimal.valueOf(amount);
        return of(bigDecimalAmount);
    }

    public static Price of(BigDecimal amount) { return new Price(amount); }

    public Price multiplyBy(long multiplier) {
        checkNotNegative(multiplier);

        BigDecimal newAmount = amount.multiply(BigDecimal.valueOf(multiplier));
        return new Price(newAmount);
    }

    @Override public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Price other = (Price) o;
        return Objects.equals(amount, other.amount);
    }

    @Override public int hashCode() { return Objects.hashCode(amount); }
}

@@ -1273,11 +1273,148 @@
 ount); %7D
+%0A%0A    public Price add(Price other) %7B%0A        BigDecimal newAmount = amount.add(other.amount);%0A        return new Price(newAmount);%0A    %7D
 %0A%7D%0A

Add adding functionality