Code example for AbstractPreferences

Methods: node, removeNode, sync

0
        assertTrue(parent.isUserNode());
        assertFalse(Preferences.systemRoot().isUserNode());
    } 
 
    public void testSync() throws BackingStoreException { 
        pref.node("new node/sub node");
        pref.sync();
 
        pref.removeNode();
 
        try { 
            pref.sync();
            fail("IllegalStateException expected");
        } catch (IllegalStateException e) {
            //expected 
        } 
    } 
 
    class MockPreferenceChangeListener implements PreferenceChangeListener {
        private boolean flagChange = false;