JUnit4TestAdapterCache () { if (ourUnit4TestAdapterCache == null) { JUnit4TestAdapterCache cache; if ("junit5".equals(System.getProperty("intellij.build.test.runner"))) { try { cache = (JUnit4TestAdapterCache)Class.forName("com.intellij.tests.JUnit5TeamCityRunnerForTestAllSuite") .getMethod("createJUnit4TestAdapterCache") .invoke(null); } catch (Throwable e) { cache = JUnit4TestAdapterCache.getDefault(); } } else { try { //noinspection SpellCheckingInspection cache = (JUnit4TestAdapterCache) Class.forName("org.apache.tools.ant.taskdefs.optional.junit.CustomJUnit4TestAdapterCache") .getMethod("getInstance") .invoke(null); } catch (Exception e) { System.out.println("Failed to create CustomJUnit4TestAdapterCache, the default JUnit4TestAdapterCache will be used" + " and ignored tests won't be properly reported: " + e); cache = JUnit4TestAdapterCache.getDefault(); } } ourUnit4TestAdapterCache = RetriesImpl.maybeEnable(cache); } return ourUnit4TestAdapterCache; }