KeyValueSet extends GenericXMLEncodable implements XMLEncodable, Map<String, Object> { public Object put(String key, Object value) { KeyValuePair kvp = _set.get(key); if (kvp != null) { throw new InvalidParameterException("Duplicate keys not allowed"); } kvp = new KeyValuePair(key, value); _set.put(key, kvp); return value; } KeyValueSet();  KeyValueSet(Properties propertySet);  KeyValueSet(Map<String, Object> values); Object put(String key, Object value); Object get(String key); int size(); void clear(); boolean containsKey(Object key); boolean containsValue(Object value); Set<java.util.Map.Entry<String, Object>> entrySet(); Object get(Object key); boolean isEmpty(); Set<String> keySet(); void putAll(Map<? extends String, ? extends Object> t); Object remove(Object key); Collection<Object> values(); @Override void decode(XMLDecoder decoder); @Override void encode(XMLEncoder encoder); @Override boolean equals(Object obj); @Override int hashCode(); @Override long getElementLabel(); @Override boolean validate();  }
@Test public void testEncodeDecode() throws MalformedContentNameStringException { Log.info(Log.FAC_TEST, "Starting testEncodeDecode"); KeyValueSet cd = new KeyValueSet(); KeyValueSet cdec = new KeyValueSet(); KeyValueSet bdec = new KeyValueSet(); cd.put("test1", 1); cd.put("test2", 1.5F); cd.put("test3", "test3"); cd.put("test4", new byte[]{1,2,3,4}); cd.put("test5", ContentName.fromNative("/ccn/TestKeySetTest")); XMLEncodableTester.encodeDecodeTest("Collection", cd, cdec, bdec); Log.info(Log.FAC_TEST, "Completed testEncodeDecode"); }