public void retainAllUsers(Collection<String> users) { Lock lock = xLock.writeLock(); lock.lock(); try { X.removeAll(new NotContainsPredicate<>(users)); } finally { lock.unlock(); } }
public void retainAllItems(Collection<String> items) { Lock lock = yLock.writeLock(); lock.lock(); try { Y.removeAll(new NotContainsPredicate<>(items)); } finally { lock.unlock(); } }