Java api : how to append/add a object to array using java highlevel client

I required equivalent java code to perform below request using HighLevelRestClient and UpdateRequest

curl -X POST "localhost:9200/test/_doc/1/_update" -H 'Content-Type: application/json' -d'

{
"script" : {
"source": "ctx._source.tags.add(params.tag)",
"lang": "painless",
"params" : {
"tag" : "blue"
}
}
}
'