debugged setSelection, hasNoCycles