OrderedProperties extends Properties { @Override public synchronized Object put(Object key, Object value) { addPropertyName(key); return super.put(key, value); } 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(expected = NullPointerException.class) public void testPutNull() { orderedProperties.put("key3", null); }