Buggy code:
public abstract class AbstractQuery extends Operator implements Evaluable , Query { private static boolean debugUSE = false ; public AbstractQuery ( String ... name ) { } protected static TraversalDescription td_IS ; protected static TraversalDescription td_IS_leaf ; protected static TraversalDescription td_IS_down ; protected static TraversalDescription THE_by_REF ; protected boolean filtering ( final PFlow pf , final Relationship ref , final Set < Node > uses , final Set < Node > weaks ) { } protected boolean filtering ( final PFlow pf , final Relationship ref , final Node toCheckByUSE , final Set < Node > uses , final Set < Node > weaks ) { } private void searchForUSE ( final Set < Node > uses , final Set < Node > weaks , final List < QCAVector > vectors , final Set < QCAVector > visitred ) { } private void collectUSEs ( final Set < Node > uses , final Set < Node > weaks , final Node node ) { } private void checkVectorForUSE ( final Set < Node > uses , final Set < Node > weaks , final QCAVector vector , final Set < QCAVector > visitred ) { } private void searchForUSE ( final Set < Node > uses , final Set < Node > weaks , final QCAVector vector , final Set < QCAVector > visitred ) { } protected void getUSEs ( PFlow pf , Node theNode , final Set < Node > uses , final Set < Node > weaks , final Set < Path > directed ) { } protected Node getClosestIntersection ( FastSet < Path > paths ) { } protected Relationship getThe ( Node node ) { } protected TraversalDescription getIntersectionChecktravers ( final Set < Node > mustHave , final Set < Node > shouldHave , final int was ) { return Traversal . description ( ) . depthFirst ( ) . uniqueness ( RELATIONSHIP_PATH ) . evaluator ( new Evaluator ( ) { @ Override public Evaluation evaluate ( Path path ) { Node sNode ; if ( ( path . length ( ) ) == 0 ) { sNode = path . startNode ( ) ; } else { Relationship firstR = firstRelationsip ( path ) ; Relationship lastR = path . lastRelationship ( ) ; if ( firstR . isType ( _ ) ) { if ( ( ( ( path . length ( ) ) % 2 ) == 1 ) && ( ! ( lastR . isType ( _ ) ) ) ) return EXCLUDE_AND_PRUNE ; if ( ( ( ( path . length ( ) ) % 2 ) == 0 ) && ( ! ( lastR . isType ( REF . _ ) ) ) ) return EXCLUDE_AND_PRUNE ; } else if ( firstR . isType ( REF . _ ) ) { if ( ( ( ( path . length ( ) ) % 2 ) == 0 ) && ( ! ( lastR . isType ( _ ) ) ) ) return EXCLUDE_AND_PRUNE ; if ( ( ( ( path . length ( ) ) % 2 ) == 1 ) && ( ! ( lastR . isType ( REF . _ ) ) ) ) return EXCLUDE_AND_PRUNE ; } else { return EXCLUDE_AND_PRUNE ; } sNode = lastR . getEndNode ( ) ; if ( ! ( sNode . equals ( path . endNode ( ) ) ) ) return EXCLUDE_AND_PRUNE ; } shouldHave . remove ( sNode ) ; mustHave . remove ( sNode ) ; if ( ( mustHave . size ( ) ) == 0 ) { <START_BUG> if ( ( shouldHave . size ( ) ) != was ) <END_BUG> return INCLUDE_AND_PRUNE ; } return EXCLUDE_AND_CONTINUE ; } private Relationship firstRelationsip ( Path path ) { return path . relationships ( ) . iterator ( ) . next ( ) ; } } ) ; } protected TraversalDescription getUSEtravers ( final Relationship end ) { } protected TraversalDescription getDirectedTravers ( final Node end ) { } TraversalDescription td = Traversal . description ( ) . depthFirst ( ) . uniqueness ( RELATIONSHIP_PATH ) ; protected abstract class Searcher implements Evaluator { public Evaluation _evaluate_ ( Path path , Set < Node > targets ) { } } abstract class IntersectionSearcher implements Evaluator { public Evaluation _evaluate_ ( Path path , final Set < Node > targets , final Set < Node > weakTargets , final Set < Node > intersection , final Set < Node > weakIntersection , final Set < Path > directed ) { } } abstract class DownIntersectionSearcher implements Evaluator { public Evaluation _evaluate_ ( final Path path , final Set < Node > targets , final Set < Node > weakTargets , final Set < Node > intersection , final Set < Node > weakIntersection ) { } } protected boolean isLeaf ( Node node ) { } No newline ; at end ; of file ; }

Fix:
if ( ( was == 0 ) || ( ( shouldHave . size ( ) ) != was ) )