}
if (groupContexts.size() == 0) {
// create new default context if none exists
BGContextManager contextManager = BGContextManagerImpl.getInstance();
OLATResource courseResource = OLATResourceManager.getInstance().findOrPersistResourceable(course);
BGContext context = contextManager.createAndAddBGContextToResource(defaultContextName, courseResource, groupType, null, true);
groupContexts.add(context);
doInitGroupmanagement(ureq, context, false);
} else if (groupContexts.size() == 1) {
BGContext context = (BGContext) groupContexts.get(0);