MockClassLoaderPolicy parentPolicy = createMockClassLoaderPolicy();
parentPolicy.setPathsAndPackageNames(MockLoader.class, Loader.class);
parentPolicy.setImportAll(true);
ClassLoader parentClassLoader = system.registerClassLoaderPolicy(parent, parentPolicy);
Loader parentLoader = new ClassLoaderToLoaderAdapter(parentClassLoader);
ClassLoaderDomain child = system.createAndRegisterDomain("child", ParentPolicy.AFTER_BUT_JAVA_BEFORE, parentLoader);
MockClassLoaderPolicy childPolicy = createMockClassLoaderPolicy();
childPolicy.setImportAll(true);
ClassLoader classLoader = system.registerClassLoaderPolicy(child, childPolicy);