Populating the Author field for Comments linked to a Process Instance Id

I know the following REST API COMMENT topic was asked without a reply …

Author being ignored on Rest API Calls

POST
process-api/history/historic-process-instances/[process instance id]/comments
{
“message”: “Comment message test”
}

Was wondering if there is a way via JAVA API calls to set the “author” of a comment that is linked to a process instance id

The userId is taken from Authentication.getAuthenticatedUserId(). Use the setter on Authentication to set the user Id before calling the addComment method on the TaskService.

See https://github.com/flowable/flowable-engine/blob/master/modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/AddCommentCmd.java#L97