DefaultPropertyManager extends PropertyManager { public List<Bean> list(Schema schema, Map<String, Schema> schemas) { List<Bean> beans = new ArrayList<>(); Config schemaConfig; try { String schemaName = schema.getName().replaceAll("\\$", "\\."); schemaConfig = config.getConfig(schemaName); if (schemaConfig == null) { return beans; } } catch (Exception e) { return beans; } if (schema.getId().isSingleton()) { final Bean bean = Bean.create(BeanId.createSingleton(schema.getName())); beans.add(bean); constructBean(schemaConfig, schema, bean, schemas); } else { for (Object instanceId : schemaConfig.root().keySet()) { Config instance = schemaConfig.getConfig(instanceId.toString()); final Bean bean = Bean.create(BeanId.create(instanceId.toString(), schema.getName())); beans.add(bean); constructBean(instance, schema, bean, schemas); } } return beans; } DefaultPropertyManager();  DefaultPropertyManager(File file); Optional<String> get(String name); List<Bean> list(Schema schema, Map<String, Schema> schemas); static final String PROPERTY_FILE_PROPERTY; }
@Test public void test_list_instances() { List<Bean> beans = properties.list(instances, schemas); Assert.assertThat(beans.size(), Is.is(2)); for (Bean bean : beans) { assertBean(bean); } }