code: public static <T> HtmlPage toHtmlPage(T item) {
          if (item instanceof HtmlPage) {
              return (HtmlPage) item;
          }
          if (item instanceof String) {
              return toHtmlPage((String) item);
          }
          if (item instanceof Reader) {
              return toHtmlPage((Reader) item);
          }
          if (item instanceof URL) {
              return toHtmlPage((URL) item);
          }
          if (item instanceof InputStream) {
              return toHtmlPage((InputStream) item);
          }
          if (item instanceof WebDriver) {
              return toHtmlPage((WebDriver) item);
          }
          throw new UnsupportedOperationException("Unable to create HtmlPage from " + item.getClass() + ".");
      }
docs: Creates a {@link HtmlPage} from the given <code>item</code> if it is of one of the supported types.
  <p>
  <b>Supported types:</b>
  <ul> <li>com.gargoylesoftware.htmlunit.html.HtmlPage</li> <li>java.io.InputStream</li> <li>java.io.Reader</li>
  <li>java.lang.String</li> <li>java.net.URL</li><li>org.openqa.selenium.WebDriver</li> </ul>
  
  @param item item that should be transformed into a {@link HtmlPage}
  @param <T>  type of the item that should be transformed
  @return {@link HtmlPage} constructed from the given input