@Test
public void testAddRuleWithPatterns() {

    final RuleImpl rule = new RuleImpl( "only patterns" );
    final Pattern c1 = new Pattern( 0,
                            new ClassObjectType( String.class ) );
    final Pattern c2 = new Pattern( 1,
                            new ClassObjectType( String.class ) );
    final Pattern c3 = new Pattern( 2,
                            new ClassObjectType( String.class ) );
    final GroupElement lhsroot = GroupElementFactory.newAndInstance();
    lhsroot.addChild( c1 );
    lhsroot.addChild( c2 );
    lhsroot.addChild( c3 );
    rule.setLhs( lhsroot );
    final Consequence consequence = new Consequence() {
        public void evaluate(KnowledgeHelper knowledgeHelper,
                             WorkingMemory workingMemory) throws Exception {
            System.out.println( "Consequence!" );
        }
        public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
        }
        public void writeExternal(ObjectOutput out) throws IOException {
        }
        
        public String getName() {
            return "default";
        }
    };
    rule.setConsequence( consequence );
    final List terminals = this.builder.addRule( rule,
                                           this.rulebase );
    assertEquals( "Rule must have a single terminal node",
                         1,
                         terminals.size() );
    final RuleTerminalNode terminal = (RuleTerminalNode) terminals.get( 0 );
}