import java.awt.color.ColorSpace;
import java.awt.color.ICC_Profile;

public class App {

    public static void main(String[] args) throws Exception {
        for (int i = 0; i < 100; i++) {
            System.out.println(i + 1);
            test();
        }
    }

    private static void test() throws InterruptedException {
        Thread[] threads = new Thread[10];
        for (int i = 0; i < threads.length; i++) {
            threads[i] = new Thread(App::loadData, "thread-" + i);
        }
        for (Thread thread : threads) {
            thread.start();
        }
        for (Thread thread : threads) {
            thread.join();
        }
    }

    // works when synchronized
// private synchronized static void loadData() {
    private static void loadData() {
        ICC_Profile.getInstance(ColorSpace.CS_sRGB).getData();
    }
} 