### Question:
UserConfig extends AbstractConfig { public synchronized void setRootPath(final Path path) throws IOException { if (path != null && !path.toString().isEmpty()) { setProperty(PROPERTY_ROOTPATH, path.toString()); if(OsUtils.isWindows()) { WinRegistry.setRootPath(path); } } else { removeProperty(PROPERTY_ROOTPATH); } saveProperties(); } UserConfig(final Path file); synchronized Path getRootPath(); synchronized boolean hasRootPath(); synchronized void setRootPath(final Path path); synchronized String getUsername(); synchronized boolean hasUsername(); synchronized void setUsername(final String username); synchronized String getPassword(); synchronized boolean hasPassword(); synchronized void setPassword(final String password); synchronized String getPin(); synchronized boolean hasPin(); synchronized void setPin(final String pin); synchronized boolean isAutoLoginEnabled(); synchronized void setAutoLogin(boolean enabled);  }### Answer:
@Test public void testSetRootPath() throws IOException { userConfig.setRootPath(Paths.get("")); assertNull(userConfig.getRootPath()); userConfigAssertPersistence(userConfig, configFile); userConfig.setRootPath(Paths.get("/this/is/a/Path")); assertEquals(userConfig.getRootPath(), Paths.get("/this/is/a/Path")); userConfigAssertPersistence(userConfig, configFile); if (!OsUtils.isWindows()) { userConfig.setRootPath(Paths.get("/this/is/a/Path/John Doe ")); assertEquals(userConfig.getRootPath(), Paths.get("/this/is/a/Path/John Doe ")); userConfigAssertPersistence(userConfig, configFile); } userConfig.setRootPath(null); assertNull(userConfig.getRootPath()); userConfigAssertPersistence(userConfig, configFile); }