### Question:
IrisFileName { public static boolean isValid(String fileName) { if (fileName == null) return false; if (fileName.equals(".") || fileName.equals("..")) return false; final int length = fileName.length(); if (length == 0 || length > MAX_FILENAME_LENGTH) return false; final char lastChar = fileName.charAt(length - 1); if (lastChar == '.') return false; if (Character.isWhitespace(lastChar)) return false; if (containsInvalidCharacter(fileName)) return false; int dot = fileName.indexOf('.'); String basename = dot == -1 ? fileName : fileName.substring(0, dot); if (Arrays.binarySearch(INVALID_RESOURCE_BASENAMES, basename.toLowerCase()) >= 0) { return false; } return Arrays.binarySearch(INVALID_RESOURCE_FULLNAMES, fileName.toLowerCase()) < 0; }  static Boolean containsInvalidCharacter(String fileName); static String clean(String fileName, String invalidCharReplacement); static boolean isValid(String fileName); static final int MAX_FILENAME_LENGTH; }### Answer:
@Test public void testIsValid() { Boolean result = IrisFileName.isValid("good.txt"); Assert.assertTrue(result); result = IrisFileName.isValid("foo-ä-€.html"); Assert.assertTrue(result); result = IrisFileName.isValid("dsfd*.html"); Assert.assertFalse(result); result = IrisFileName.isValid("com1"); Assert.assertFalse(result); String tooLong = new String(new char[256]).replace('\0', 'w'); result = IrisFileName.isValid(tooLong); Assert.assertFalse(result); result = IrisFileName.isValid(" \t"); Assert.assertFalse(result); }