TestClassLoaderPolicy policy1 = new TestClassLoaderPolicy();
TestClassLoaderPolicy policy2 = new TestClassLoaderPolicy();
TestClassLoaderPolicyFactory factory1 = new TestClassLoaderPolicyFactory(policy1, true);
TestClassLoaderPolicyFactory factory2 = new TestClassLoaderPolicyFactory(policy2, true);
policy1.setDelegates(Collections.singletonList(new FilteredDelegateLoader(factory2)));
policy2.setDelegates(Collections.singletonList(new FilteredDelegateLoader(factory1)));
ClassLoader classLoader1 = system.registerClassLoaderPolicy(policy1);
ClassLoader classLoader2 = system.registerClassLoaderPolicy(policy2);
assertLoadClass(TestClass.class, classLoader1, classLoader2);
assertNull("Should NOT have tried policy1 ", policy1.getResourceInvoked);