### Question:
StorageManagerUtil { public static boolean isValidFilenameNoExtension(String basename) { if (StringUtils.isBlank(basename)) { return false; } if (!isValidPath(basename)) { return false; } Pattern pattern = Pattern.compile(REGEXP_FILE_BASENAME); Matcher matcher = pattern.matcher(basename); 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 isValidFilenameNoExtension() { Assert.assertFalse(StorageManagerUtil.isValidFilenameNoExtension(null)); Assert.assertFalse(StorageManagerUtil.isValidFilenameNoExtension(" ")); Assert.assertTrue(StorageManagerUtil.isValidFilenameNoExtension("filename")); Assert.assertTrue(StorageManagerUtil.isValidFilenameNoExtension("filename.txt")); Assert.assertTrue(StorageManagerUtil.isValidFilenameNoExtension("file name.png")); Assert.assertTrue(StorageManagerUtil.isValidFilenameNoExtension("file_name.png")); Assert.assertTrue(StorageManagerUtil.isValidFilenameNoExtension("file_name (1).jpeg")); Assert.assertFalse(StorageManagerUtil.isValidFilenameNoExtension("file_?name (1).jpeg")); Assert.assertFalse(StorageManagerUtil.isValidFilenameNoExtension("file_../name")); Assert.assertFalse(StorageManagerUtil.isValidFilenameNoExtension("file_../name.jpg")); Assert.assertFalse(StorageManagerUtil.isValidFilenameNoExtension("file_nam%2e%2e/e.jpg")); Assert.assertFalse(StorageManagerUtil.isValidFilenameNoExtension("fi..%2fle_name.jpg")); Assert.assertFalse(StorageManagerUtil.isValidFilenameNoExtension("file_na%2e%2e%2fme.jpg")); }