What is the recommended way to discover a coordinator?

I’m wondering how XCTU discovers a coordinator on the serial port. What type of checks/tests are done once the serial port has been opened to ensure that a XStick is connected, and not some other device?

I’m specifically interested to know if there is an existing method in the XBee Java library that can be used?

XCTU only polls or query some of the radios AT commands.