@Override @Test public void checkTheLocatorOverridingOnAWidget() { try { assertTrue(rottenTomatoes.getFakedMovieCount() == 0); } catch (Exception e) { if (!NoSuchElementException.class.isAssignableFrom(e.getClass())) throw e; } rottenTomatoes.getASimpleMovie(0).goToReview(); try { rottenTomatoes.checkFakeReview(); } catch (Exception e) { if (NoSuchElementException.class.isAssignableFrom(e.getClass())) return; else throw e; } throw new RuntimeException("Any exception was expected"); }