### Question:
StringProcessor { public static String cleanFileName(String badFileName) { if (StringUtils.isNotBlank(badFileName)) { List<Integer> bads = Arrays.asList( 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 34, 42, 47, 58, 60, 62, 63, 92, 124 ); Set<Integer> badChars = new HashSet<>(); badChars.addAll(bads); StringBuilder cleanName = new StringBuilder(); for (int i = 0; i < badFileName.length(); i++) { int c = (int) badFileName.charAt(i); if (badChars.contains(c) == false) { cleanName.append((char) c); } } return cleanName.toString(); } return badFileName; }  static ObjectMapper defaultObjectMapper(); static String getResourceNameFromUrl(String url); static String getJustFileName(String originalFilename); static List<String> extractUrls(String text); static String stripeExtendedChars(String data); static String createHrefUrls(String text); static String createHrefUrls(String text, boolean showFullURL); static String stripeFieldJSON(String json, Set<String> fieldsToKeep); static String printObject(Object o); static String ellipseString(String data, int max_length); static String blankIfNull(String text); static String blankIfNull(Object text); static String nullIfBlank(String text); static Boolean isEmail(String text); static String stripHtml(String text); static BigDecimal archtecureCodeToDecimal(String code); static String urlEncode(String value); static String urlDecode(String value); static String parseStackTraceHtml(Throwable throwable); static String enclose(String s); static String enclose(String s, String enclose); static String enclose(String s, String encloseStart, String encloseEnd); static String encodeWebKey(String key); static String cleanEntityKey(String key); static String getFileExtension(String filename); static String cleanFileName(String badFileName); static String puralize(int size, String nonPuralForm, String puralForm); static String getHexFromBytes(byte[] bytes); static String decodeHexCharEscapes(String input); static boolean stringIsNotBlank(String input); static String formatForFilename(String input); static String uniqueId(); static String truncateHTML(String html, int maxCharCount); static Map<String, List<String>> splitURLQuery(String query); static String removeBadStyles(String html); static String escapeHtmlQuotes(String input);  }### Answer:
@Test public void testCleanFileName() { System.out.println("testCleanFileName: "); String testFileName = null; String result = cleanFileName(testFileName); String expResult = null; assertEquals(result, expResult); testFileName = ""; result = cleanFileName(testFileName); expResult = ""; assertEquals(result, expResult); testFileName = "Second*Try\".Rpt"; result = cleanFileName(testFileName); expResult = "SecondTry.Rpt"; assertEquals(result, expResult); testFileName = "My?" + (char) (7) + "Urgent|Memo/.txt"; result = cleanFileName(testFileName); expResult = "MyUrgentMemo.txt"; assertEquals(result, expResult); testFileName = "my|Back" + (char) (28) + "Flip.gif"; result = cleanFileName(testFileName); expResult = "myBackFlip.gif"; assertEquals(result, expResult); }