Dn dn = new Dn( "dc=test,ou=test,ou=system" );
dn.apply( schemaManager );
searchCtx.setDn( dn );
ExprNode filter = FilterParser.parse( schemaManager, "(ObjectClass=domain)" );
NameComponentNormalizer ncn = new ConcreteNameComponentNormalizer( schemaManager );
FilterNormalizingVisitor visitor = new FilterNormalizingVisitor( ncn, schemaManager );
filter.accept( visitor );
searchCtx.setFilter( filter );
searchCtx.setScope( SearchScope.SUBTREE );