@Override public void clearSeenVersion(WaveletId waveletId) { seenVersion.remove(waveletId); }
@Override public void setThreadState(String threadId, ThreadState val) { if (val == null) { threadStates.remove(threadId); } else { threadStates.put(threadId, val); } }
@Override public void setState(String key, String value) { Preconditions.checkNotNull(key, "Private gadget state key is null."); if (value != null) { state.put(key, value); } else { state.remove(key); } } }
@Override public void setIndexability(ParticipantId participant, IndexDecision indexability) { Preconditions.checkNotNull(participant, "Null participant"); IndexDecision current = getIndexability(participant); if (indexability == null) { if (current != null) { data.remove(participant); } } else { data.put(participant, indexability); } }
/** Tests basic functionality of remove method. */ public void testRemove() { assertNull(map.get("A")); map.put("A", 1); assertEquals(Integer.valueOf(1), map.get("A")); map.remove("A"); assertNull(map.get("A")); } }
/** Tests basic functionality of remove method. */ public void testRemove() { assertNull(map.get("A")); map.put("A", 1); assertEquals(Integer.valueOf(1), map.get("A")); map.remove("A"); assertNull(map.get("A")); } }
/** Tests functionality of keySet method. */ public void testKeySet() { // Should be empty to begin with assertEquals(CollectionUtils.immutableSet(), makeHashSet(map.keySet())); // Test with adding data map.put("A", 1); map.put("B", 2); assertEquals(CollectionUtils.immutableSet("A", "B"), makeHashSet(map.keySet())); map.put("C", 3); assertEquals(CollectionUtils.immutableSet("A", "B", "C"), makeHashSet(map.keySet())); // Remove something map.remove("B"); assertEquals(CollectionUtils.immutableSet("A", "C"), makeHashSet(map.keySet())); }
/** Tests functionality of keySet method. */ public void testKeySet() { // Should be empty to begin with assertEquals(CollectionUtils.immutableSet(), makeHashSet(map.keySet())); // Test with adding data map.put("A", 1); map.put("B", 2); assertEquals(CollectionUtils.immutableSet("A", "B"), makeHashSet(map.keySet())); map.put("C", 3); assertEquals(CollectionUtils.immutableSet("A", "B", "C"), makeHashSet(map.keySet())); // Remove something map.remove("B"); assertEquals(CollectionUtils.immutableSet("A", "C"), makeHashSet(map.keySet())); }