How to set ArrayList<Long> process variable

I process external task from camunda. My application is procesing task using java. My application and camunda are interact together during rest. Then I am going to set process instance variable of type ArrayList<Long>. In my application I am set variable as ArrayList<Long> but in camunda it’s variable apear as ArrayList<Integer>. I know that for the camunda my variable comes as json.

How to pass variable with type ArrayList<Long> to camunda?
How to construct json that camunda understand as ArrayList<Long>?