thank you guys for your coments, i just aded random tests.
You could generate a random board and then either generate random (non-matching) directions or pick one of the directions from the board.
issue with random test is that if i generate random boards and random directions, most likely what happenes is that they will never match.
Needs random tests.
It should be fine now, thanks a lot.
The initial solution name is doneOrNot() instead of findSafeRoute()