public void replayAddKey(EncryptionKeyPB keyPB) {
        EncryptionKey key = create(keyPB);
        keysLock.writeLock().lock();
        try {
            idToKey.put(key.id, key);
        } finally {
            keysLock.writeLock().unlock();
        }
    }
@Test
    public void testReplayAddKey() {
        KeyMgr keyMgr = new KeyMgr();
        EncryptionKeyPB pb = new EncryptionKeyPB();
        pb.id = 1L;
        pb.algorithm = EncryptionAlgorithmPB.AES_128;
        pb.encryptedKey = new byte[16];
        pb.type = EncryptionKeyTypePB.NORMAL_KEY;
        pb.createTime = 3L;
        keyMgr.replayAddKey(pb);
    }