public Cos createCos(String name, Map cosAttrs) throws ServiceException {
public Cos createCos(String name, Map<String, Object> cosAttrs) throws ServiceException {
    public Cos createCos(String name, Map cosAttrs) throws ServiceException {        name = name.toLowerCase().trim();        if (!sValidCosName.matcher(name).matches())            throw ServiceException.INVALID_REQUEST("invalid name: "+name, null);        HashMap attrManagerContext = new HashMap();        AttributeManager.getInstance().preModify(cosAttrs, null, attrManagerContext, true, true);        DirContext ctxt = null;        try {            ctxt = LdapUtil.getDirContext(true);            Attributes attrs = new BasicAttributes(true);            LdapUtil.mapToAttrs(cosAttrs, attrs);            Attribute oc = LdapUtil.addAttr(attrs, A_objectClass, "zimbraCOS");                        String zimbraIdStr = LdapUtil.generateUUID();            attrs.put(A_zimbraId, zimbraIdStr);            attrs.put(A_cn, name);            String dn = cosNametoDN(name);            createSubcontext(ctxt, dn, attrs, "createCos");            Cos cos = getCosById(zimbraIdStr, ctxt);            AttributeManager.getInstance().postModify(cosAttrs, cos, attrManagerContext, true);            return cos;        } catch (NameAlreadyBoundException nabe) {            throw AccountServiceException.COS_EXISTS(name);        } finally {            LdapUtil.closeContext(ctxt);        }    }