Code example for KeyManagementException

0
            if (identities.containsKey(id))
                throw new KeyManagementException(
                        "This Identity is already contained in the scope"); 
            if (getIdentity(id.getPublicKey()) != null)
                throw new KeyManagementException(
                        "This Identity's public key already exists in the scope"); 
            identities.put(id, id);
        } 
 
        public void removeIdentity(Identity id) throws KeyManagementException {
            if (!identities.containsKey(id))
                throw new KeyManagementException(
                        "This Identity is not contained in the scope"); 
            identities.remove(id);
        } 
    } 
 
    /** 
     * @tests java.security.IdentityScope#IdentityScope() 
     */ 
    @TestTargetNew(