OrderedProperties extends Properties { @Override public Enumeration<?> propertyNames() { return Collections.enumeration(propertyNames); } OrderedProperties(); @Override synchronized Object put(Object key, Object value); @Override Set<String> stringPropertyNames(); @Override Enumeration<?> propertyNames(); @Override synchronized Enumeration<Object> keys(); @Override Set<Object> keySet(); @Override Set<Entry<Object, Object>> entrySet(); @Override synchronized void putAll(Map<?, ?> t); @Override synchronized void clear(); @Override synchronized Object remove(Object key);  }
@Test public void testPropertyNames() { Enumeration<?> propertyNames = orderedProperties.propertyNames(); assertEquals("key1", propertyNames.nextElement()); assertEquals("key2", propertyNames.nextElement()); }