/** * Marks key as unlocked. * * @param key Key. * @return {@code True} if last locked key was unlocked. */ boolean unlocked(Object key) { locked.remove(key); return locked.isEmpty(); }
/** * Marks key as locked. * * @param key Key. */ void locked(Object key) { locked.add(key); }