ConfigAccessor { public <T> List<T> getList(String key, Mapper<String, T> converter) { List<T> result = new ArrayList<>(); for (String item : getStringList(key)) { result.add(converter.map(item)); } return result; } ConfigAccessor(JSONObject jsonObject); static ConfigAccessor emptyConfig(); T getBean(String key, Class<? extends ExtractableBeanBuilder<T>> beanBuilderClass); Class<?> getClass(String key, Class<?> defaultValue); boolean hasKey(String key); Duration getDuration(String key, String defaultValue); long getDurationSeconds(String key, String defaultValue); long getDurationMillis(String key, String defaultValue); long getSizeBytes(String key, String defaultValue); long getSizeBytes(String key, Long defaultValue); Boolean getBoolean(String key); Boolean getBoolean(String key, Boolean defaultValue); String getString(String key); String getString(String key, String defaultValue); int getInt(String key); int getInt(String key, Integer defaultValue); long getLong(String key); long getLong(String key, Long defaultValue); double getDouble(String key); double getDouble(String key, Double defaultValue); Map<String, String> getStringMap(String key); List<T> getList(String key, Mapper<String, T> converter); List<String> getStringList(String key); List<ByteArray> getByteArrayList(String key); List<String> getKeys(); Map<String, String> getConfigAsMap(); @Override String toString(); String toString(int indentFactor);  }
@Test(groups = "fast") public void testGetList() throws Exception { List<Period> periodList = configAccessor.getList("list", new StringToPeriodMapper()); Assert.assertEquals(periodList.size(), 2); Assert.assertEquals(periodList.get(0), Period.hours(24)); Assert.assertEquals(periodList.get(1), Period.hours(24 * 7)); }