package project.monitor.pledgegalaxy; import java.util.Collections; import java.util.HashSet; import java.util.Set; public class PledgeLock { private static final Set filter = Collections.synchronizedSet(new HashSet()); public static boolean add(String partyId) { if (!filter.add(partyId)) { return false; } else { return true; } } public static void remove(String partyId) { filter.remove(partyId); } }