final PackageBuilder pkgBuilder = new PackageBuilder();
pkgBuilder.addPackage( new PackageDescr( "org.drools" ) );
final PackageBuilderConfiguration conf = pkgBuilder.getPackageBuilderConfiguration();
PackageRegistry pkgReg = pkgBuilder.getPackageRegistry( "org.drools" );
Package pkg = pkgReg.getPackage();
DialectCompiletimeRegistry dialectRegistry = pkgReg.getDialectCompiletimeRegistry();
Dialect dialect = dialectRegistry.getDialect( "java" );
RuleDescr ruleDescr = new RuleDescr("test rule");
RuleBuildContext context = new RuleBuildContext( pkgBuilder, ruleDescr, dialectRegistry, pkg, dialect);
Accumulate accumulate = (Accumulate) builder.build( context, accumDescr );