### Question:
DevTools { public void addBrowser(String name, Browser browser, CefBrowser browserDevTools) { browser.addCreatedHandler((b) -> { JFrame frame = frameFactory.createFrameFor(this, browser, browserDevTools); registeredBrowsers.put(browser, new DevToolsData(name, browserDevTools, frame)); }); } DevTools();   DevTools(FrameFactory frameFactory); void addBrowser(String name, Browser browser, CefBrowser browserDevTools); void removeBrowser(Browser browser); void removeBrowser(Browser browser, Runnable afterClose);  }### Answer:
@Test void opensDevToolsAfterBrowserWasInitializedCompletely() { FrameFactory frameFactory = mock(FrameFactory.class); DevTools devTools = new DevTools(frameFactory); Browser browser = mock(Browser.class); CefBrowser browserDevTools = mock(CefBrowser.class); devTools.addBrowser("ignore", browser, browserDevTools); ArgumentCaptor<Consumer<Browser>> createHandler = ArgumentCaptor.forClass(Consumer.class); verify(browser).addCreatedHandler(createHandler.capture()); createHandler.getValue().accept(browser); verify(frameFactory).createFrameFor(devTools, browser, browserDevTools); }