### Question:
StorageManagerUtil { public static boolean isValidExtension(String extension) { if (StringUtils.isBlank(extension)) { return false; } Pattern pattern = Pattern.compile(REGEXP_FILE_EXTENSION); Matcher matcher = pattern.matcher(extension); return matcher.matches(); } private  StorageManagerUtil(); static boolean isValidFilename(String fullname); static boolean isValidFilename(String basename, String extension); static boolean isValidFilenameNoExtension(String basename); static boolean isValidDirName(String basename); static boolean isValidExtension(String extension);  }### Answer:
@Test public void isValidExtension() { Assert.assertFalse(StorageManagerUtil.isValidExtension(null)); Assert.assertTrue(StorageManagerUtil.isValidExtension("extension")); Assert.assertTrue(StorageManagerUtil.isValidExtension("txt")); Assert.assertTrue(StorageManagerUtil.isValidExtension("t_t")); Assert.assertFalse(StorageManagerUtil.isValidExtension("t..t")); Assert.assertFalse(StorageManagerUtil.isValidExtension("t t")); Assert.assertFalse(StorageManagerUtil.isValidExtension("(1)")); Assert.assertFalse(StorageManagerUtil.isValidExtension("r_?n")); Assert.assertFalse(StorageManagerUtil.isValidExtension("d_../ex")); Assert.assertFalse(StorageManagerUtil.isValidExtension("%2e%2e/e")); Assert.assertFalse(StorageManagerUtil.isValidExtension("ex..%2f_n")); Assert.assertFalse(StorageManagerUtil.isValidExtension("dir_na%2e%2e%2fme")); }