Javascript, get Group and User Candidates via Task Listener

Good afternoon,
I create the following variable on the Task Listener (Event Type - Create) via JavaScript (Inline Script):

task.setVariable(“current_task_Candidates”,task.getCandidates());
I end up getting the contents of an IdentityLink of type java.util.HashSet.

How can I convert the contents of a variable into a readable format (for example, JSON, which can then be parsed) without using Java?
Is it possible to do this in some way through JavaScript (Inline Script) or expressions?