/** * Removes a given property * * @param property key of the property to remove * @return value of the removed property or null if there was no corresponding key */ public String removeProperty(String property) { return super.removeProperty(property); }
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")); }