### Question:
HttpHeadersTools { public static String set2commastr(Set<String> values) { int i; List<String> valList = new ArrayList<String>(values); Collections.sort(valList); Object[] objAry = valList.toArray(); StringBuilder sb = new StringBuilder(); if (objAry.length == 0) { return sb.toString(); } i = 1; for (i = 0; i < objAry.length - 1; i++) { sb.append(String.format("%s,", (String) objAry[i])); } sb.append(objAry[i]); return sb.toString(); } HttpHeadersTools();  HttpHeadersTools(HttpServletRequest req, HttpServletResponse res); boolean isValidAuth(); boolean isBasicAuth(); HttpServletRequest getReq(); void setReq(HttpServletRequest req); HttpServletResponse getRes(); void setRes(HttpServletResponse res); String getBasicString(); String getBasicUser(); String getBasicPassword(); boolean isHeaderTrue(String name); static Set<String> commastr2set(String valueStr); static String set2commastr(Set<String> values);  }### Answer:
@Test public void testShouldMapCommaListEmpty() { String strList = HttpHeadersTools.set2commastr(emptySet); assertEquals("", strList); }
@Test public void testShouldMapCommaListWithOneItem() { String strList = HttpHeadersTools.set2commastr(oneItem); assertEquals("AAA", strList); }
@Test public void testShouldMapCommaListWithThreeItems() { String strList = HttpHeadersTools.set2commastr(threeItems); assertEquals("AAA,BBB,CCC", strList); }