Find master ID

I am using elastic 7.2 and HighLevelRestClient in my JAVA project.
How can I find the master node using the client?
Something like _cat/master in the Elastic REST API

You can use _master to refer to the currently-elected master node in various cluster APIs such as GET _nodes/_master. But it is rather unusual to need to identify the currently-elected master, so you might be heading down the wrong path if you think you need to do this.