@Override
    public int compareTo(MonetaryAmount o) {
        Objects.requireNonNull(o);
        int compare = getCurrency().getCurrencyCode().compareTo(o.getCurrency().getCurrencyCode());
        if (compare == 0) {
            compare = this.number.compareTo(Money.from(o).number);
        }
        return compare;
    }
@ Override public int compareTo ( MonetaryAmount o ) { Objects . requireNonNull ( o ) ; int compare = getCurrency ( ) . getCurrencyCode ( ) . compareTo ( o . getCurrency ( ) . getCurrencyCode ( ) ) ; if ( compare == 0 ) { compare = this . number . compareTo ( Money . from ( o ) . number ) ; } return compare ; }
/*
@see java.lang.Comparable#compareTo(java.lang.Object)