### Question:
HtmlPageUtil { public static HtmlPage toHtmlPage(String string) { try { URL url = new URL("http: return new HtmlUnitNekoHtmlParser().parseHtml( new StringWebResponse(string, url), new WebClient().getCurrentWindow() ); } catch (IOException e) { throw new RuntimeException("Error creating HtmlPage from String.", e); } } private  HtmlPageUtil(); static HtmlPage toHtmlPage(String string); static HtmlPage toHtmlPage(InputStream inputStream); static HtmlPage toHtmlPage(Reader reader); static HtmlPage toHtmlPage(URL url); static HtmlPage toHtmlPage(WebDriver webDriver); static HtmlPage toHtmlPage(T item);  }### Answer:
@Test public void createValidHtmlPageFromString() throws Exception { assertCorrectHtmlPage(HtmlPageUtil.toHtmlPage(TestPage.asString())); }
@Test public void createValidHtmlPageFromInputStream() throws Exception { InputStream is = IOUtils.toInputStream(TestPage.asString()); assertCorrectHtmlPage(HtmlPageUtil.toHtmlPage(is)); }
@Test public void createValidHtmlPageFromReader() throws Exception { Reader reader = new StringReader(TestPage.asString()); assertCorrectHtmlPage(HtmlPageUtil.toHtmlPage(reader)); }
@Test public void createValidHtmlPageFromURL() throws Exception { assertCorrectHtmlPage(HtmlPageUtil.toHtmlPage(TestPage.asURL())); }
@Test public void createValidHtmlPageFromURLAsObject() throws Exception { assertCorrectHtmlPage(HtmlPageUtil.toHtmlPage((Object) TestPage.asURL())); }
@Test public void createValidHtmlPageFromSeleniumWebDriver() throws Exception { assertCorrectHtmlPage(HtmlPageUtil.toHtmlPage(TestPage.asWebDriver())); }
@Test public void createValidHtmlPageFromSeleniumWebDriverAsObject() throws Exception { assertCorrectHtmlPage(HtmlPageUtil.toHtmlPage((Object) TestPage.asWebDriver())); }
@Test(expected = UnsupportedOperationException.class) public void createHtmlPageFromUnsupportedTypeThrowsException() throws Exception { HtmlPageUtil.toHtmlPage(new Object()); }