src/main/java/com/zopa/service/LoanValidationService.java
/**
     * @param loan detail
     * @return
     * @throws InvalidRequestAmountException
     */
@param loan detail
@return
@throws InvalidRequestAmountException
@param loan detail @return @throws InvalidRequestAmountException
@Override
    public boolean validateLoan(Loan loan) throws InvalidRequestAmountException {
        if (loan.getRequestedAmount().compareTo(LOWER_RANGE) < 0 || loan.getRequestedAmount().compareTo(UPPER_RANGE) > 0) {
            throw new InvalidRequestAmountException("The requested amount is out of range 1000 and 15000");
        }
        BigDecimal remainder = loan.getRequestedAmount().remainder(INCREMENT_AMOUNT);
        if (remainder.intValueExact() > 0)
            throw new InvalidRequestAmountException("The requested amount is not incremental of 100");
        return true;
    }
@ Override public boolean validateLoan ( Loan loan ) throws InvalidRequestAmountException { if ( loan . getRequestedAmount ( ) . compareTo ( LOWER_RANGE ) < 0 || loan . getRequestedAmount ( ) . compareTo ( UPPER_RANGE ) > 0 ) { throw new InvalidRequestAmountException ( "The requested amount is out of range 1000 and 15000" ) ; } BigDecimal remainder = loan . getRequestedAmount ( ) . remainder ( INCREMENT_AMOUNT ) ; if ( remainder . intValueExact ( ) > 0 ) throw new InvalidRequestAmountException ( "The requested amount is not incremental of 100" ) ; return true ; }
@param loan detail
 @return
 @throws InvalidRequestAmountException
@param loan detail @return @throws InvalidRequestAmountException