### Question:
UserConfig extends AbstractConfig { public synchronized boolean hasUsername() { return getUsername() != null && !getUsername().isEmpty(); } 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 testHasUsername() throws IOException { userConfig.setUsername(""); assertFalse(userConfig.hasUsername()); userConfig.setUsername(" "); assertFalse(userConfig.hasUsername()); userConfig.setUsername("testuser"); assertTrue(userConfig.hasUsername()); userConfig.setUsername(null); assertFalse(userConfig.hasUsername()); }