/** * Store a new property key and value * * @param property key of the property to store * @param propertyValue value of the property to store * @return previous value with the same key, otherwise null if the key didn't exist */ public String setProperty(String property, String propertyValue) { return super.setProperty(property, propertyValue); }
public void testProperty() throws Exception { HashMap<String, String> properties = new HashMap<>(); properties.put("Color", "Red"); properties.put("Width", "3"); feature = new Feature(null, null, properties); assertFalse(feature.hasProperty("llama")); assertTrue(feature.hasProperty("Color")); assertEquals("Red", feature.getProperty("Color")); assertTrue(feature.hasProperty("Width")); assertEquals("3", feature.getProperty("Width")); assertNull(feature.removeProperty("banana")); assertEquals("3", feature.removeProperty("Width")); assertNull(feature.setProperty("Width", "10")); assertEquals("10", feature.setProperty("Width", "500")); }