assertEquals( "There should be 2 rule level declarations",
2,
rule.getDeclarations().size() );
// second GE should be a not
final GroupElement not = (GroupElement) rule.getLhs().getChildren().get( 1 );
assertTrue( not.isNot() );
// not has no outer declarations
assertTrue( not.getOuterDeclarations().isEmpty() );
assertEquals( 1,
not.getInnerDeclarations().size() );
assertTrue( not.getInnerDeclarations().keySet().contains( "$state" ) );
// second not
final GroupElement not2 = (GroupElement) ((GroupElement) not.getChildren().get( 0 )).getChildren().get( 1 );
assertTrue( not2.isNot() );
// not has no outer declarations
assertTrue( not2.getOuterDeclarations().isEmpty() );
assertEquals( 1,
not2.getInnerDeclarations().size() );
assertTrue( not2.getInnerDeclarations().keySet().contains( "$likes" ) );
}