public Account(
     int accountNum,
     int initialDeposit,
     Branch branch,
     CustomerInfo customerInfo,
     AccountType type) {
   if (type.getInitialDeposit() > initialDeposit)
     throw new IllegalArgumentException("initial deposit is too small");
   if (customerInfo == null) throw new IllegalArgumentException("customerInfo should be passed");
   this.accountNum = accountNum;
   this.balance = initialDeposit;
   this.branch = branch;
   this.customerInfo = customerInfo;
   this.type = type;
   this.frozen = false;
   this.transactions = new LinkedList<>();
 }