LayerIdentifierFactory { public static List<LayerIdentifier> readFromPropertiesFile(String baseName) { ResourceBundle bundle = ResourceBundle.getBundle(baseName); TreeMap<Integer, LayerIdentifier> result = new TreeMap<Integer, LayerIdentifier>(); Enumeration<String> bundleKeys = bundle.getKeys(); while (bundleKeys.hasMoreElements()) { String key = bundleKeys.nextElement(); if (isLayerIdentifierKey(key)) { Integer layerIndex = getLayerIndexFromKey(key); String layerName = getLayerNameFromKey(key); String layerLocation = bundle.getString(key); result.put(layerIndex, new LayerIdentifierImpl(layerName, layerLocation)); } } return new ArrayList<LayerIdentifier>(result.values()); }  static List<LayerIdentifier> readFromPropertiesFile(String baseName); static LayerIdentifier createFromLayer(Layer layer); static LayerIdentifier createFromDefinition(URL definitionLocation);  }
@Test public void testLoadFromPropertiesFile() { List<LayerIdentifier> result = LayerIdentifierFactory.readFromPropertiesFile("au.gov.ga.worldwind.animator.layers.testLayerIdentities"); assertNotNull(result); assertEquals(3, result.size()); assertEquals("Layer1", result.get(0).getName()); assertEquals("Layer 2", result.get(1).getName()); assertEquals("Another - Layer", result.get(2).getName()); assertEquals("http: assertEquals("http: assertEquals("http: }