Please see the source code example available in the doc/api-examples/java/create_group directory of your MFT Server installation.