### Question:
KmlContainerParser { static KmlContainer createContainer(XmlPullParser parser) throws XmlPullParserException, IOException { return assignPropertiesToContainer(parser); }    }### Answer:
@Test public void testCreateContainerProperty() throws Exception { XmlPullParser xmlPullParser = createParser("amu_basic_folder.kml"); KmlContainer kmlContainer = KmlContainerParser.createContainer(xmlPullParser); assertTrue(kmlContainer.hasProperties()); assertEquals("Basic Folder", kmlContainer.getProperty("name")); xmlPullParser = createParser("amu_unknown_folder.kml"); kmlContainer = KmlContainerParser.createContainer(xmlPullParser); assertTrue(kmlContainer.hasProperty("name")); }
@Test public void testCreateContainerPlacemark() throws Exception { XmlPullParser xmlPullParser = createParser("amu_basic_folder.kml"); KmlContainer kmlContainer = KmlContainerParser.createContainer(xmlPullParser); assertTrue(kmlContainer.hasPlacemarks()); assertEquals(1, kmlContainer.getPlacemarksHashMap().size()); xmlPullParser = createParser("amu_multiple_placemarks.kml"); kmlContainer = KmlContainerParser.createContainer(xmlPullParser); assertTrue(kmlContainer.hasPlacemarks()); assertEquals(2, kmlContainer.getPlacemarksHashMap().size()); }
@Test public void testCreateContainerGroundOverlay() throws Exception { XmlPullParser xmlPullParser = createParser("amu_ground_overlay.kml"); KmlContainer kmlContainer = KmlContainerParser.createContainer(xmlPullParser); assertEquals(2, kmlContainer.getGroundOverlayHashMap().size()); }
@Test public void testCreateContainerObjects() throws Exception { XmlPullParser xmlPullParser = createParser("amu_nested_folders.kml"); KmlContainer kmlContainer = KmlContainerParser.createContainer(xmlPullParser); assertNotNull(kmlContainer.getContainers()); int numberOfNestedContainers = 0; for (KmlContainer container : kmlContainer.getContainers()) { numberOfNestedContainers++; } assertEquals(2, numberOfNestedContainers); }
@Test public void testCDataEntity() throws Exception { XmlPullParser xmlPullParser = createParser("amu_cdata.kml"); KmlContainer kmlContainer = KmlContainerParser.createContainer(xmlPullParser); assertEquals("TELEPORT", kmlContainer.getProperty("description")); }