The application is built using 2 classes.
Account class models how much money a person has. Two main methods are deposit and withdraw. Account may never have negative deposit. (There is an if statement preventing that). Bank class models registering account and getting existing account (by id).
Both classes have a lot of bugs.
There is a 3rd class BankRunner which has a main method.
This class runs a simulation, where some number of accounts is created.
Then some random transfers are done. This is performed using multiple threads.
After that the overall amount of money on accounts should not change.
This seems not to be the case.
Your job is to find bugs and other problems in the implementation.
- Make corrections to the Account and Bank classes. (if you do not have time, please simply list the problems that you see).
- You may also have to change BankRunner class! In such case, please try to preserve its intended logic.
- Additionally try to fix or list other potential code quality issues that you see.
- You are free to create additional classes or files as needed.