public Group createGroup(Principal principal, String intermediatePath) throws AuthorizableExistsException, RepositoryException {
if (principal == null) {
throw new IllegalArgumentException("Principal might not be null.");
}
if (hasAuthorizableOrReferee(principal)) {
throw new AuthorizableExistsException("Authorizable for '" + principal.getName() + "' already exists: ");
}
NodeImpl parent = null;
try {
String parentPath = getParentPath(intermediatePath, GROUPS_PATH);