Created
July 27, 2011 17:46
-
-
Save achambers/1109960 to your computer and use it in GitHub Desktop.
insufficient_funds_java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public Account withdraw(long accountNumber, BigDecimal withdrawalAmount) { | |
Account account = accountDao.get(accountNumber); | |
if(!account.hasSufficientFunds(withdrawalAmount)) { | |
throw new InsufficientFundsException(); | |
} | |
//some code here | |
return account; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment