protected void logout(AbstractPage targetPage) {
   if (!(targetPage instanceof PageWithLogOutAction)) {
     throw new IllegalArgumentException(
         targetPage.getClass().getSimpleName() + " must implement PageWithLogOutAction interface");
   }
   targetPage.navigateTo();
   assertCurrentUrlStartsWith(targetPage);
   ((PageWithLogOutAction) targetPage).logOut();
 }