What is the Python code related to collection actions for blender 2.8?
Here an example i made, it will place the active object to a new collection. 
it's a really simple example i hope it can help the beginner (like me) out there.

import bpy

obj = bpy.context.object
obj_old_coll = obj.users_collection #list of all collection the obj is in

new_coll = bpy.data.collections.new(name="COLLECTION TEST") #create new coll in data
bpy.context.scene.collection.children.link(new_coll) #add new coll to the scene
new_coll.objects.link(obj) #link obj to scene

for ob in obj_old_coll: #unlink from all  precedent obj collections
    ob.objects.unlink(obj)


here another examples:

import bpy

A = bpy.context.object
A_old_coll = A.users_collection #list of all collection the obj is in

terrain_coll_name = "Scatter: ["+A.name+"]"+" Terrain"
if terrain_coll_name not in bpy.data.collections: #if this collection name is not in all collection already:
    terrain_coll = bpy.data.collections.new(name=terrain_coll_name) #create new coll in data
    bpy.context.scene.collection.children.link(terrain_coll) #add new coll to the scene
else:
    terrain_coll = bpy.data.collections[terrain_coll_name] #else let re use the already existing one

terrain_coll.objects.link(A) #link obj to terrain coll

for ob in A_old_coll: #unlink from all  precedent obj collections
    ob.objects.unlink(A)