### Question:
ViewConfig { public List<InstanceConfig> getInstances() { return instances == null ? Collections.emptyList() : instances; }  String getName(); String getLabel(); String getDescription(); String getVersion(); String getBuild(); String getMinAmbariVersion(); String getMaxAmbariVersion(); String getIcon(); String getIcon64(); boolean isSystem(); String getExtraClasspath(); String getView(); Class<? extends View> getViewClass(ClassLoader cl); String getDataMigrator(); Class<? extends ViewDataMigrator> getDataMigratorClass(ClassLoader cl); int getDataVersion(); String getValidator(); Class<? extends Validator> getValidatorClass(ClassLoader cl); String getMasker(); Class<? extends Masker> getMaskerClass(ClassLoader cl); List<ParameterConfig> getParameters(); List<ResourceConfig> getResources(); AutoInstanceConfig getAutoInstance(); List<InstanceConfig> getInstances(); PersistenceConfig getPersistence(); List<PermissionConfig> getPermissions(); String getClusterConfigOptions();  }### Answer:
@Test public void testGetInstances() throws Exception { ViewConfig config = getConfig(xml); List<InstanceConfig> instances = config.getInstances(); Assert.assertEquals(2, instances.size()); Assert.assertEquals("INSTANCE1", instances.get(0).getName()); Assert.assertEquals("INSTANCE2", instances.get(1).getName()); config = getConfig(minimal_xml); instances = config.getInstances(); Assert.assertNotNull(instances); Assert.assertEquals(0, instances.size()); }