What you have is pretty close to all the combinations of your keywords. I'm not sure what the colons you have are for. Maybe you can modify some simple code that prints out all combinations to do what you want.
When run with:
java Combo 1 2 3 4
it produces:
1 2 3 4
1 2 3
1 2 4
1 2
1 3 4
1 3
1 4
1
2 3 4
2 3
2 4
2
3 4
3
4