### Question:
StringUtil { public static String getProjectName(String mailListName, String mailListCategory) { if (mailListCategory == null || mailListCategory.trim().isEmpty()) { return mailListName; } if (mailListName != null && !mailListName.trim().isEmpty()) { String name = mailListName.trim(); String category = "-"+mailListCategory.trim(); if (name.length() > category.length()) { if (name.endsWith(category)) { return name.substring(0, name.length() - category.length()); } } } return mailListName; }  static String decodeFilenameSafe(String encoded); static URLInfo getInfo(String encoded); static String getProjectName(String mailListName, String mailListCategory);  }### Answer:
@Test public void testProjectName() { assertEquals(null, StringUtil.getProjectName(null, "")); assertEquals(" ", StringUtil.getProjectName(" ", null)); assertEquals(" ", StringUtil.getProjectName(" ", "")); assertEquals("a-b", StringUtil.getProjectName("a-b", " ")); assertEquals("a-b", StringUtil.getProjectName("a-b", "")); assertEquals("a-b", StringUtil.getProjectName("a-b", null)); assertEquals("a-b", StringUtil.getProjectName("a-b-c", "c")); assertEquals("a-b_c", StringUtil.getProjectName("a-b_c", "c")); }