public static class Counter extends Thread {
    @Override
    public void run() {
        do {
            synchronized (Solution.class) {
                incrementCount();
                values[getCount()]++;
            }

            Thread.currentThread().yield();
        } while (getCount() < 100);
    }
}