### Question:
UtilFile { public static String normalizeExtension(String file, String extension) { Check.notNull(file); Check.notNull(extension); final int length = file.length() + Constant.DOT.length() + extension.length(); final StringBuilder builder = new StringBuilder(length).append(removeExtension(file)).append(Constant.DOT); if (extension.startsWith(Constant.DOT)) { builder.append(getExtension(extension)); } else { builder.append(extension); } return builder.toString(); } private  UtilFile(); static String removeExtension(String file); static String normalizeExtension(String file, String extension); static String getExtension(String file); static String getExtension(File file); static List<File> getFiles(File directory); static List<File> getFilesByExtension(File path, String extension); static List<File> getFilesByName(File path, String name); static void deleteFile(File file); static boolean exists(String path); static boolean isFile(String path); static boolean isType(File file, String extension);  }### Answer:
@Test void testNormalizeExtension() { assertEquals("temp.tmp", UtilFile.normalizeExtension("temp", "tmp")); assertEquals("temp.tmp", UtilFile.normalizeExtension("temp", ".tmp")); assertEquals("temp.tmp", UtilFile.normalizeExtension("temp", "..tmp")); assertEquals("temp.tmp", UtilFile.normalizeExtension("temp.tmp", ".tmp")); assertEquals("temp.tmp", UtilFile.normalizeExtension("temp.txt", ".tmp")); }
@Test void testNormalizeExtensionNullFile() { assertThrows(() -> UtilFile.normalizeExtension(null, ""), Check.ERROR_NULL); }
@Test void testNormalizeExtensionNullExtension() { assertThrows(() -> UtilFile.normalizeExtension("", null), Check.ERROR_NULL); }