@Test public void lostNodeFound() { ServerConfigurationStore configStore = createConfigStore(); configStore.handleNodeLost(mAddressOne); configStore.handleNodeLost(mAddressTwo); Map<Address, List<ConfigRecord>> confMap = configStore.getConfMap(); assertFalse(confMap.containsKey(mAddressOne)); assertFalse(confMap.containsKey(mAddressTwo)); configStore.lostNodeFound(mAddressTwo); confMap = configStore.getConfMap(); assertFalse(confMap.containsKey(mAddressOne)); assertTrue(confMap.containsKey(mAddressTwo)); }
public synchronized void lostNodeFound(Address address) { Preconditions.checkNotNull(address, "address should not be null"); mLostNodes.remove(address); for (Runnable function : mChangeListeners) { function.run(); } }
ServerConfigurationStore { public synchronized void lostNodeFound(Address address) { Preconditions.checkNotNull(address, "address should not be null"); mLostNodes.remove(address); for (Runnable function : mChangeListeners) { function.run(); } } }
ServerConfigurationStore { public synchronized void lostNodeFound(Address address) { Preconditions.checkNotNull(address, "address should not be null"); mLostNodes.remove(address); for (Runnable function : mChangeListeners) { function.run(); } } ServerConfigurationStore(); }
ServerConfigurationStore { public synchronized void lostNodeFound(Address address) { Preconditions.checkNotNull(address, "address should not be null"); mLostNodes.remove(address); for (Runnable function : mChangeListeners) { function.run(); } } ServerConfigurationStore(); synchronized void reset(); synchronized void registerNewConf(Address address, List<ConfigProperty> configList); synchronized void handleNodeLost(Address address); synchronized void lostNodeFound(Address address); synchronized Map<Address, List<ConfigRecord>> getConfMap(); synchronized List<Address> getLiveNodeAddresses(); synchronized void registerChangeListener(Runnable function); }
ServerConfigurationStore { public synchronized void lostNodeFound(Address address) { Preconditions.checkNotNull(address, "address should not be null"); mLostNodes.remove(address); for (Runnable function : mChangeListeners) { function.run(); } } ServerConfigurationStore(); synchronized void reset(); synchronized void registerNewConf(Address address, List<ConfigProperty> configList); synchronized void handleNodeLost(Address address); synchronized void lostNodeFound(Address address); synchronized Map<Address, List<ConfigRecord>> getConfMap(); synchronized List<Address> getLiveNodeAddresses(); synchronized void registerChangeListener(Runnable function);  }