DynamicSetProperty implements Property<Set<T>> { public Set<T> get() { return values; } DynamicSetProperty(String propName, String defaultValue);  DynamicSetProperty(String propName, String defaultValue, String delimiterRegex);  DynamicSetProperty(String propName, Set<T> defaultValue);  DynamicSetProperty(String propName, Set<T> defaultValue, String delimiterRegex);  DynamicSetProperty(String propName, Set<T> defaultValue, Splitter splitter); Set<T> get(); @Override Set<T> getValue(); @Override Set<T> getDefaultValue(); @Override long getChangedTimestamp(); @Override void addCallback(Runnable callback); @Override void removeAllCallbacks(); @Override String getName(); static final String DEFAULT_DELIMITER; }
@Test public void test() { DynamicIntegerSetProperty dp = new DynamicIntegerSetProperty("testProperty", Sets.newLinkedHashSet(Arrays.asList(5,1,2,3,4))); Set<Integer> current = dp.get(); Assert.assertEquals(Arrays.asList(5,1,2,3,4), Lists.newArrayList(current)); ConfigurationManager.getConfigInstance().setProperty("testProperty", "2,3,4,5,6,7,8,9,1"); current = dp.get(); Assert.assertEquals(Arrays.asList(2,3,4,5,6,7,8,9,1), Lists.newArrayList(current)); }