How do you attach an existing session?

I created session by Appium Inspector.

I want to attach this session by java code.

e.g.

AndroidDriver driver = new AndroidDriver(???);

How do you attach an existing session?