docs: public static Expect4j telnet(String hostname, int port) throws Exception {
          // This library has trouble with EOF
          final TelnetClient client = new TelnetClient();
  
          TerminalTypeOptionHandler ttopt = new TerminalTypeOptionHandler("VT100", false, false, true, true);
          EchoOptionHandler echoopt = new EchoOptionHandler(true, false, true, false);
          SuppressGAOptionHandler gaopt = new SuppressGAOptionHandler(false, false, false, false);
          client.addOptionHandler( ttopt );
          client.addOptionHandler( echoopt );
          client.addOptionHandler( gaopt );
  
          client.connect(hostname, port);
          InputStream is =  new FromNetASCIIInputStream( client.getInputStream() ); // null until client connected
          OutputStream os = new ToNetASCIIOutputStream( client.getOutputStream() );
  
          /*
          URL url=new URL("telnet", hostname, port, "",  new thor.net.URLStreamHandler());
          final URLConnection urlConnection=url.openConnection();
          urlConnection.connect();
          if (urlConnection instanceof TelnetURLConnection) {
              ((TelnetURLConnection)urlConnection).setTelnetTerminalHandler(new SimpleTelnetTerminalHandler());
          }
          OutputStream os=urlConnection.getOutputStream();
          InputStream is=urlConnection.getInputStream();
  
          StreamPair pair = new StreamPair(is, os) {
              public void close() {
                  try { ((TelnetURLConnection)urlConnection).disconnect(); }catch(Exception e) { }
              }
          };
           */
  
          return new Expect4j(is, os) {
              public void close() {
                  super.close();
                  try {
                      client.disconnect();
                  } catch (IOException e) {
                      logger.error("Failed to close telnet session", e);
                  }
              }
          };
      }