convert given-when to if-else