### Question:
ResourceValidationUtils { public static boolean isValidResourceName(String resourceName) { return validateResourceName(resourceName, true); }  static boolean isValidResourceName(String resourceName); static boolean isValidLibraryName(String libraryName); static boolean isValidLibraryName(String libraryName, boolean allowSlash); static boolean isValidResourceId(String resourceId); static boolean isValidViewResource(String resourceId); static boolean isValidContractName(String contractName); static boolean isValidLocalePrefix(String localePrefix); static boolean isValidPath(String path);  }### Answer:
@Test public void testResourceNames() throws Exception { Assert.assertTrue(ResourceValidationUtils.isValidResourceName("myres")); Assert.assertTrue(ResourceValidationUtils.isValidResourceName("myres.css")); Assert.assertTrue(ResourceValidationUtils.isValidResourceName("/myres")); Assert.assertTrue(ResourceValidationUtils.isValidResourceName("/mydir/./myres.css")); Assert.assertTrue(ResourceValidationUtils.isValidResourceName("org.apache.myfaces")); Assert.assertTrue(ResourceValidationUtils.isValidResourceName("my_res_file.css")); Assert.assertTrue(ResourceValidationUtils.isValidResourceName("my-res-file.css")); Assert.assertFalse(ResourceValidationUtils.isValidResourceName("myres"+'\t'+"22")); Assert.assertFalse(ResourceValidationUtils.isValidResourceName("\\myres")); Assert.assertFalse(ResourceValidationUtils.isValidResourceName("..")); Assert.assertFalse(ResourceValidationUtils.isValidResourceName("../")); Assert.assertFalse(ResourceValidationUtils.isValidResourceName("/..")); Assert.assertFalse(ResourceValidationUtils.isValidResourceName("\\..")); Assert.assertFalse(ResourceValidationUtils.isValidResourceName("..\\")); Assert.assertFalse(ResourceValidationUtils.isValidResourceName("myres.css/..")); Assert.assertFalse(ResourceValidationUtils.isValidResourceName("myres.css\\..")); Assert.assertFalse(ResourceValidationUtils.isValidResourceName("../myres.css")); Assert.assertFalse(ResourceValidationUtils.isValidResourceName("..\\myres.css")); Assert.assertFalse(ResourceValidationUtils.isValidResourceName("my/../res.css")); Assert.assertFalse(ResourceValidationUtils.isValidResourceName("my\\../res.css")); Assert.assertFalse(ResourceValidationUtils.isValidResourceName("my/..\\res.css")); Assert.assertFalse(ResourceValidationUtils.isValidResourceName("/mydir/../myres.css")); Assert.assertFalse(ResourceValidationUtils.isValidResourceName("my_res:file.css")); Assert.assertFalse(ResourceValidationUtils.isValidResourceName("my_res?file.css")); Assert.assertFalse(ResourceValidationUtils.isValidResourceName("my_res&file.css")); }