### Question:
UserConfig extends AbstractConfig { public synchronized void setPin(final String pin) throws IOException { if(pin != null && !pin.isEmpty()) { setProperty(PROPERTY_PIN, pin); } else { removeProperty(PROPERTY_PIN); } 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 testSetPin() throws IOException { userConfig.setPin(""); assertNull(userConfig.getPin()); userConfigAssertPersistence(userConfig, configFile); userConfig.setPin("ThisIs-MyPin"); assertEquals(userConfig.getPin(), "ThisIs-MyPin"); assertNotEquals(userConfig.getPin(), "ThisIs-MyPin".toLowerCase()); userConfigAssertPersistence(userConfig, configFile); userConfig.setPin(" another pin 123 "); assertEquals(userConfig.getPin(), " another pin 123 "); assertNotEquals(userConfig.getPin(), " another pin 123 ".trim()); userConfigAssertPersistence(userConfig, configFile); userConfig.setPin(null); assertNull(userConfig.getPin()); userConfigAssertPersistence(userConfig, configFile); }