### Question:
UserConfig extends AbstractConfig { public synchronized void setPassword(final String password) throws IOException { if (password != null && !password.isEmpty()) { setProperty(PROPERTY_PASSWORD, password); } else { removeProperty(PROPERTY_PASSWORD); } 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 testSetPassword() throws IOException { userConfig.setPassword(""); assertNull(userConfig.getPassword()); userConfigAssertPersistence(userConfig, configFile); userConfig.setPassword("mySecret#Password123"); assertEquals(userConfig.getPassword(), "mySecret#Password123"); assertNotEquals(userConfig.getPassword(), "mySecret#Password123".toLowerCase()); userConfigAssertPersistence(userConfig, configFile); userConfig.setPassword(" my secret passwort "); assertEquals(userConfig.getPassword(), " my secret passwort "); assertNotEquals(userConfig.getPassword(), " my secret passwort ".trim()); userConfigAssertPersistence(userConfig, configFile); userConfig.setPassword(null); assertNull(userConfig.getPassword()); userConfigAssertPersistence(userConfig, configFile); }