BootstrapHandler extends SynchronizedRequestHandler { protected static Optional<String> resolvePageTitle( BootstrapContext context) { String title = context.getUI().getInternals().getTitle(); if (title != null) { context.getUI().getInternals().cancelPendingTitleUpdate(); } return Optional.ofNullable(title); } BootstrapHandler(); protected  BootstrapHandler(PageBuilder pageBuilder); @Override boolean synchronizedHandleRequest(VaadinSession session,
            VaadinRequest request, VaadinResponse response);  }
@Test public void testInitialPageTitle_pageSetTitle_noExecuteJavascript() { initUI(testUI, createVaadinRequest()); String overriddenPageTitle = "overridden"; testUI.getPage().setTitle(overriddenPageTitle); assertEquals(overriddenPageTitle, BootstrapHandler.resolvePageTitle(context).get()); assertEquals(0, testUI.getInternals().dumpPendingJavaScriptInvocations() .size()); }
@Test public void testInitialPageTitle_nullTitle_noTitle() { initUI(testUI, createVaadinRequest()); assertFalse(BootstrapHandler.resolvePageTitle(context).isPresent()); }