NoMatchClassFilter filter = new NoMatchClassFilter(MockLoader.class);
ParentPolicy pp = new ParentPolicy(filter, ClassFilter.NOTHING);
ClassLoaderDomain parent = system.createAndRegisterDomain("parent", ParentPolicy.BEFORE_BUT_JAVA_ONLY);
ClassLoaderDomain child = system.createAndRegisterDomain("child", pp, parent);
MockClassLoaderPolicy parentPolicy = createMockClassLoaderPolicy();
parentPolicy.setPathsAndPackageNames(MockLoader.class, Loader.class);
system.registerClassLoaderPolicy(parent, parentPolicy);
MockClassLoaderPolicy childPolicy = createMockClassLoaderPolicy();
childPolicy.setPathsAndPackageNames(MockLoader.class, Loader.class);
ClassLoader classLoader = system.registerClassLoaderPolicy(child, childPolicy);
assertLoadClass(MockLoader.class, classLoader);
assertTrue("Should have been filtered", filter.filtered);
}