code: public static ChaiGroup createGroup( final String parentDN, final String name, final ChaiProvider provider )
              throws ChaiOperationException, ChaiUnavailableException
      {
          //Get a good CN for it
          final String objectCN = findUniqueName( name, parentDN, provider );
  
          //Concantonate the entryDN
          final StringBuilder entryDN = new StringBuilder();
          entryDN.append( "cn=" );
          entryDN.append( objectCN );
          entryDN.append( ',' );
          entryDN.append( parentDN );
  
          //First create the base group.
          provider.createEntry( entryDN.toString(), ChaiConstant.OBJECTCLASS_BASE_LDAP_GROUP, Collections.emptyMap() );
  
          //Now build an ldapentry object to add attributes to it
          final ChaiEntry theObject = provider.getEntryFactory().newChaiEntry( entryDN.toString() );
  
          //Add the description
          theObject.writeStringAttribute( ChaiConstant.ATTR_LDAP_DESCRIPTION, name );
  
          //Return the newly created group.
          return provider.getEntryFactory().newChaiGroup( entryDN.toString() );
      }
docs: Creates a new group entry in the ldap directory.  A new "groupOfNames" object is created.
  The "cn" and "description" ldap attributes are set to the supplied name.
  
  @param parentDN the entryDN of the new group.
  @param name     name of the group
  @param provider a ldap provider be used to create the group.
  @return an instance of the ChaiGroup entry
  @throws ChaiOperationException   If there is an error during the operation
  @throws ChaiUnavailableException If the directory server(s) are unavailable