Snappy: Collocate, set 'masterProduct'

The example is from the times were on two products could be collocated in one step.
Now, you can collocate more products and there are more options. This can make it more complicated or easier.
If all your products cover already the same region, and you just want to create a stack then you can leave out the master/slave parameters.
Instead you can simply add a comma separated list of all products paths to the parameters map.

parameters.put("sourceProductPaths", pathsList)
GPF.createProduct('Collocate', parameters)

If you want to define a master, the one which defines the geographical extent, then find this one in SNAP desktop and get the name of it.
Right-click on it in the Product Explorer and select Properties. Here the name is shown and you can copy it.
Set this name as parameter ‘masterProductName’.

parameters.put("sourceProductPaths", pathsList)
parameters.put("masterProductName", 'THE_NAME_OF_THE_PRODUCT')
GPF.createProduct('Collocate', parameters)

This should do it.