private static void initThreadInfo() throws IOException {
        Thread threads[] = new Thread[10];
        Thread.State status[] = new Thread.State[10];
        for(int i = 0; i < COUNT; i++) {
            threads[i] = new Thread(new Calculator(i));
            if (i % 2 == 0) {
                threads[i].setPriority(Thread.MAX_PRIORITY);
            } else {
                threads[i].setPriority(Thread.MIN_PRIORITY);
            }
            threads[i].setName("CalculatorThread_" + i);
        }

        try(FileWriter file = new FileWriter("\\data\\log.txt"); PrintWriter pw = new PrintWriter(file)) {
            for(int i = 0; i < COUNT; i++) {
                pw.println("Main: Status of " + threads[i].getName() + " : " + threads[i].getState());
                status[i] = threads[i].getState();
            }
            for(int i = 0; i < COUNT; i++) {
                threads[i].start();
            }

            boolean finish = false;
            while(!finish) {
                for(int i = 0; i< COUNT; i++) {
                    if(threads[i].getState() != status[i]) {
                        writeThreadInfo(pw, threads[i], status[i]);
                        status[i] = threads[i].getState();
                    }
                }
                finish = true;
                for(int i = 0; i < COUNT; i++) {
                    finish = finish && (threads[i].getState() == Thread.State.TERMINATED);
                }
            }
        }


    }