@Override
    public void run() {
        System.out.println("Bank thread started");

        String hours = new SimpleDateFormat("HH").format(Calendar.getInstance().getTime());
        String minutes = new SimpleDateFormat("mm").format(Calendar.getInstance().getTime());
        String seconds = new SimpleDateFormat("ss").format(Calendar.getInstance().getTime());
        String millis = new SimpleDateFormat("SSS").format(Calendar.getInstance().getTime());
        String curTime = hours + "_" + minutes + "_" + seconds + "_" + millis;
        log("Started at: " + curTime);

        log("Starting the main loop");

        while ((!terminated) || (requests.size() != 0)) {

            if (requests.size() != 0) {
                //System.out.print("[com.bank.Bank]: Processing a request. Name:" + requests.get(0).getUser().getName() + ". ");
                processRequest(requests.get(0));
                requests.remove(0);
            }
        }

        hours = new SimpleDateFormat("HH").format(Calendar.getInstance().getTime());
        minutes = new SimpleDateFormat("mm").format(Calendar.getInstance().getTime());
        seconds = new SimpleDateFormat("ss").format(Calendar.getInstance().getTime());
        millis = new SimpleDateFormat("SSS").format(Calendar.getInstance().getTime());
        curTime = hours + "_" + minutes + "_" + seconds + "_" + millis;
        log("Terminated at: " + curTime);

        //log.setField(4, requests.size());

        //log.listAllFields();

        LogPackage logPackage = new LogPackage(performedOperations, createOperations, creditOperations,
                depositOperations, requests.size());
        Main.bankAnalytics = logPackage;


        log.nextLine();
        log("Analytics:");
        log("Performed operations", performedOperations);
        log("Create operations", createOperations);
        log("Credit operations", creditOperations);
        log("Deposit operations", depositOperations);
        log("Unprocessed", requests.size());
        log("Something went wrong", smthWentWrong);
        log.nextLine();

        log("Terminating");

        /*
        System.out.println("[Bank] Performed operations: " + performedOperations);
        System.out.println("[Bank] Create operations: " + createOperations);
        System.out.println("[Bank] Credit operations: " + creditOperations);
        System.out.println("[Bank] Deposit operations: " + depositOperations);
        System.out.println("[Bank] Unprocessed left: " + requests.size());
        System.out.println("[Bank] Something went wrong: " + smthWentWrong);
        System.out.println("[Bank]: Terminating");
        */

        log.terminate();

        System.out.println("Bank thread terminated");
    }