@Test
public void testAndCursorWithManualFilter() throws Exception
{
AndNode andNode = new AndNode();
List<Evaluator<? extends ExprNode, Entry, Long>> evaluators = new ArrayList<Evaluator<? extends ExprNode, Entry, Long>>();
Evaluator<? extends ExprNode, Entry, Long> eval;
ExprNode exprNode = new SubstringNode( schemaManager.getAttributeType( "cn" ), "J", null );
eval = new SubstringEvaluator( (SubstringNode) exprNode, store, schemaManager );
IndexCursor<?, Entry, Long> wrapped = new SubstringCursor( store, ( SubstringEvaluator ) eval );
/* adding this results in NPE adding Presence evaluator not
Substring evaluator but adding Substring cursor as wrapped cursor */
// evaluators.add( eval );
andNode.addNode( exprNode );
exprNode = new PresenceNode( schemaManager.getAttributeType( "sn" ) );
eval = new PresenceEvaluator( (PresenceNode) exprNode, store, schemaManager );
evaluators.add( eval );
andNode.addNode( exprNode );
IndexCursor<?, Entry, Long> cursor = new AndCursor( wrapped, evaluators ); //cursorBuilder.build( andNode );
cursor.beforeFirst();