static void arrayStackTests(int t, ArrayStack arrayStack) {
        System.out.println("TREAD " + t + " ---- Example 11-2. A non-thread-safe" +
                " stack implementation was improved by adding 'synchronized'" +
                " to methods: push, pop, isEmpty, getIndex ----");
        for (int i = 0; i<9; i++) {
            arrayStack.push(i);
            System.out.println("Tread " + t + ". push(" + i + "). Index = " + arrayStack.getIndex() + " Stack: " + arrayStack);
            for (int j = 0; j<1; j++) {}
        }
        for (int i = 0; i<9; i++) {
            System.out.println("Tread " + t + ". pop(): " + arrayStack.pop() + ". Index = " + arrayStack.getIndex() + " Stack: " + arrayStack);
            for (int j = 0; j<100000; j++) {}
        }
    }