This is an example of "Java expect" with my localhost , testing a login into the application cli.
the project use jcraft and expectit.
Usually is used to login into the other bash without a trusted key, or in this case login into the shell without bash options.