@Test
public void testSetProperty() throws Exception {

    String prefix = LogManagerPropertiesTest.class.getName();
    LogManager manager = LogManager.getLogManager();
    try {
        String key = prefix.concat(".dummy");
        Properties parent = new Properties();
        parent.put(key, "value");
        parent.put("", "empty");
        read(manager, parent);
        parent = new Properties();
        LogManagerProperties mp = new LogManagerProperties(parent, prefix);
        assertFalse(contains(mp, key, null));
        assertEquals("value", mp.setProperty(key, "newValue"));
        assertFalse(contains(mp, key, "value")); //ensure copy worked.
        assertTrue(contains(mp, key, "newValue")); //ensure copy worked.
        parent.put(key, "defValue");
        assertEquals("newValue", mp.remove(key));
        assertEquals("defValue", mp.remove(key));
        assertEquals("empty", mp.setProperty("", ""));
    } finally {
        manager.reset();
    }
}