@@ -0,0 +1,1755 @@
+package com.querydsl.core;%0A%0Aimport java.net.URL;%0Aimport java.net.URLClassLoader;%0Aimport java.util.Collection;%0A%0Aimport org.junit.AfterClass;%0Aimport org.junit.BeforeClass;%0Aimport org.junit.Test;%0Aimport org.reflections.util.ClasspathHelper;%0A%0Apublic class CycleClassInitDependencyTest %7B%0A%0A    private static ClassLoader loader;%0A%0A    @BeforeClass%0A    public static void overrideClassLoader() %7B%0A        loader = Thread.currentThread().getContextClassLoader();%0A        Collection%3CURL%3E urls = ClasspathHelper.forClassLoader();%0A        ClassLoader cl = URLClassLoader.newInstance(urls.toArray(new URL%5Burls.size()%5D), null/*no delegation*/);%0A        Thread.currentThread().setContextClassLoader(cl);%0A    %7D%0A%0A    @AfterClass%0A    public static void resetClassLoader() %7B%0A        Thread.currentThread().setContextClassLoader(loader);%0A    %7D%0A%0A    @Test(timeout = 2000)%0A    public void test() throws InterruptedException %7B%0A%0A        // each thread wants to load one part of the dependency circle%0A        Thread t1 = new Thread(new LoadClassRunnable(%22com.querydsl.core.types.dsl.NumberExpression%22));%0A        Thread t2 = new Thread(new LoadClassRunnable(%22com.querydsl.core.types.dsl.Expressions%22));%0A        t1.start();%0A        t2.start();%0A%0A        t1.join();%0A%0A    %7D%0A%0A    private static class LoadClassRunnable implements Runnable %7B%0A%0A        private final String classToLoad;%0A%0A        public LoadClassRunnable(String classToLoad) %7B%0A            this.classToLoad = classToLoad;%0A        %7D%0A%0A        @Override%0A        public void run() %7B%0A            try %7B%0A                Class.forName(classToLoad, true, Thread.currentThread().getContextClassLoader());%0A            %7D catch (ClassNotFoundException e) %7B%0A                throw new RuntimeException(e);%0A            %7D%0A        %7D%0A%0A    %7D%0A%0A%7D%0A

Add test case for #1668