In Java, the simplest path is to set the proxy properties before opening the connection: the host with the address, the port with 20001 and the username and password from the order.
SOCKS5
For SOCKS5, use the SOCKS properties with port 20481. It works for what goes through Socket; libraries that manage their own connection need their own setting.
Confirm the result with the proxy tester tool: it shows the exit IP the site sees.