`getInstance` method for java api?