Index: jackrabbit-api/src/main/java/org/apache/jackrabbit/api/security/user/UserManager.java
===================================================================
--- jackrabbit-api/src/main/java/org/apache/jackrabbit/api/security/user/UserManager.java	(Revision 921844)
+++ jackrabbit-api/src/main/java/org/apache/jackrabbit/api/security/user/UserManager.java	(Arbeitskopie)
@@ -137,6 +137,22 @@
                     String intermediatePath) throws AuthorizableExistsException, RepositoryException;
 
     /**
+     * Creates a Group for the given groupID must not be <code>null</code>.
+     * <br>
+     * Same as {@link #createGroup(Principal,String)} where the specified groupID
+     * is the name of a simple <code>Principal</code> implementation and the
+     * intermediate path is <code>null</code>.
+     *
+     * @param groupID The id of the new group, must not be <code>null</code>.
+     * @return The new <code>Group</code>.
+     * @throws AuthorizableExistsException in case the given groupID is already
+     * in use or another {@link Authorizable} with the same
+     * {@link Authorizable#getID() ID} exists.
+     * @throws RepositoryException If another error occurs.
+     */
+    Group createGroup(String groupID) throws AuthorizableExistsException, RepositoryException;
+
+    /**
      * Creates a new <code>Group</code> that is based on the given principal.
      * Note that the group's ID is implementation specific. The implementation
      * may take the principal name as ID hint but must in any case assert that
Index: jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/UserManagerImpl.java
===================================================================
--- jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/UserManagerImpl.java	(Revision 921844)
+++ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/UserManagerImpl.java	(Arbeitskopie)
@@ -460,6 +460,20 @@
     }
 
     /**
+     * Create a group with the extact groupID
+     */
+    public Group createGroup(String groupID)
+    		throws AuthorizableExistsException, RepositoryException {
+        if (groupID == null || groupID.length() == 0) {
+            throw new IllegalArgumentException("Cannot create group: GroupID can neither be null nor empty String.");
+        }
+        if (internalGetAuthorizable(groupID) != null) {
+            throw new AuthorizableExistsException("User or Group for '" + groupID + "' already exists");
+        }
+    	return createGroup(groupID, new PrincipalImpl(groupID), null);
+    }
+    
+    /**
      * Same as {@link #createGroup(java.security.Principal, String )} where the
      * intermediate path is <code>null</code>.
      * @see UserManager#createGroup(Principal)
@@ -490,10 +504,17 @@
         if (!isValidPrincipal(principal)) {
             throw new IllegalArgumentException("Cannot create group: Principal may not be null and must have a valid name.");
         }
+        String groupID = getGroupId(principal.getName());
+        return createGroup(groupID, principal, intermediatePath);
+    }
+    
+    private Group createGroup(String groupID, Principal principal, String intermediatePath) throws AuthorizableExistsException, RepositoryException {
         try {
-            String groupID = getGroupId(principal.getName());
             NodeImpl groupNode = (NodeImpl) nodeCreator.createGroupNode(groupID, intermediatePath);
-            setPrincipal(groupNode, principal);
+            
+            if (principal != null) {
+            	setPrincipal(groupNode, principal);
+            }
 
             Group group = createGroup(groupNode);
             if (isAutoSave()) {
@@ -507,6 +528,7 @@
             log.debug("newInstance new Group failed, revert changes on parent");
             throw e;
         }
+    	
     }
 
     /**
Index: jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/user/UserImporterTest.java
===================================================================
--- jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/user/UserImporterTest.java	(Revision 921844)
+++ jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/user/UserImporterTest.java	(Arbeitskopie)
@@ -1283,6 +1283,10 @@
                     return null;
                 }
 
+                public Group createGroup(String groupID) throws AuthorizableExistsException, RepositoryException {
+                	return null;
+                }
+                
                 public Group createGroup(Principal principal) throws AuthorizableExistsException, RepositoryException {
                     return null;
                 }
Index: jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/user/UserManagerImplTest.java
===================================================================
--- jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/user/UserManagerImplTest.java	(Revision 921844)
+++ jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/user/UserManagerImplTest.java	(Arbeitskopie)
@@ -18,6 +18,7 @@
 
 import org.apache.jackrabbit.api.security.user.AbstractUserTest;
 import org.apache.jackrabbit.api.security.user.Authorizable;
+import org.apache.jackrabbit.api.security.user.AuthorizableExistsException;
 import org.apache.jackrabbit.api.security.user.Group;
 import org.apache.jackrabbit.api.security.user.User;
 import org.apache.jackrabbit.api.security.user.UserManager;
@@ -165,6 +166,72 @@
         }
     }
 
+    public void testCreateGroupWithGroupId() throws RepositoryException, NotExecutableException {
+        Principal p = getTestPrincipal();
+        String uid = getTestUserId(p);
+
+        User u = null;
+        try {
+        	// create a user with the given ID
+            u = userMgr.createUser(uid, buildPassword(uid), p, null);
+            save(superuser);
+            
+            // assert AuthorizableExistsException for duplicate group ID
+            Group gr = null;
+            try {
+            	gr = userMgr.createGroup(uid);
+            	fail("Unexpected duplicate group with ID " + uid);
+            } catch (AuthorizableExistsException aee) {
+            	// expected this
+            } finally {
+                if (gr != null) {
+                    gr.remove();
+                    save(superuser);
+                }
+            }
+            
+        } finally {
+            if (u != null) {
+                u.remove();
+                save(superuser);
+            }
+        }
+    }
+
+    public void testCreateGroupWithGroupIdSameAsUserId() throws RepositoryException, NotExecutableException {
+        Principal p = getTestPrincipal();
+        String uid = getTestUserId(p);
+
+        Group gr = null;
+        try {
+        	
+        	// assert group creation with exact ID
+            gr = userMgr.createGroup(uid);
+            save(superuser);
+            assertEquals("Expect group with exact ID", uid, gr.getID());
+            
+            // assert AuthorizableExistsException for duplicate group ID
+            Group gr2 = null;
+            try {
+            	gr2 = userMgr.createGroup(uid);
+            	fail("Unexpected duplicate group with ID " + uid);
+            } catch (AuthorizableExistsException aee) {
+            	// expected this
+            } finally {
+                if (gr2 != null) {
+                    gr2.remove();
+                    save(superuser);
+                }
+            }
+            
+        } finally {
+            if (gr != null) {
+                gr.remove();
+                save(superuser);
+            }
+        }
+    }
+
     public void testFindAuthorizable() throws RepositoryException, NotExecutableException {
         Authorizable auth;
         Set<Principal> principals = getPrincipalSetFromSession(superuser);
