@Test
public void testAndCursorWithManualFilter() throws Exception
{
AndNode andNode = new AndNode();
List<Evaluator<? extends ExprNode, ServerEntry, Long>> evaluators = new ArrayList<Evaluator<? extends ExprNode, ServerEntry, Long>>();
Evaluator<? extends ExprNode, ServerEntry, Long> eval;
ExprNode exprNode = new SubstringNode( "cn", "J", null );
eval = new SubstringEvaluator( ( SubstringNode ) exprNode, store, schemaManager );
IndexCursor<?, ServerEntry, 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( "sn" );
eval = new PresenceEvaluator( ( PresenceNode ) exprNode, store, schemaManager );
evaluators.add( eval );
andNode.addNode( exprNode );
IndexCursor<?, ServerEntry, Long> cursor = new AndCursor( wrapped, evaluators ); //cursorBuilder.build( andNode );
cursor.beforeFirst();