### Question:
UserConfigUtils { public static UserConfig createUserConfig(String username) { String filename = createFileName(username); Path file = AppData.getConfigFolder().resolve(filename); UserConfig cfg = createUserConfig(file); return cfg; } private  UserConfigUtils(); static UserConfig createUserConfig(String username); static UserConfig createUserConfig(Path file); static Map<String, UserConfig> getAllConfigFiles();  }### Answer:
@Test public void testCreateUserConfig_ByUsername() { String sha256 = "96d9632f363564cc3032521409cf22a852f2032eec099ed5967c0d000cec607a"; String username = "John"; Path expectedFile = Paths.get(String.format("%s.conf", sha256)); UserConfig cfg = UserConfigUtils.createUserConfig(username); assertNotNull(cfg); assertEquals(expectedFile, cfg.getConfigFile().getFileName()); cfg = UserConfigUtils.createUserConfig(username.toLowerCase()); assertNotNull(cfg); assertEquals(expectedFile, cfg.getConfigFile().getFileName()); cfg = UserConfigUtils.createUserConfig(username.toUpperCase()); assertNotNull(cfg); assertEquals(expectedFile, cfg.getConfigFile().getFileName()); }
@Test public void testCreateUserConfig_ByFile() { Path file = Paths.get(FileUtils.getTempDirectoryPath(), "userconfig_test.conf"); UserConfig cfg = UserConfigUtils.createUserConfig(file); assertNotNull(cfg); assertEquals(file, cfg.getConfigFile()); }