### Question:
StringUtils { public static String addQuotesIfNecessary (String string) { if (!string.contains(" ")) return string; StringBuilder sb = new StringBuilder(); if (!string.startsWith("\"")) sb.append("\""); sb.append(string); if (!string.endsWith("\"")) sb.append("\""); return sb.toString(); } private  StringUtils(); static String addQuotesIfNecessary(String string); static String generateRandomString(int length); static String convertCamelCaseToSentence(String camelCase); static String trimSpaces(String original);  }### Answer:
@Test public void addQuotesIfNecessary () { assertEquals("abc", StringUtils.addQuotesIfNecessary("abc")); assertEquals("\"ab cd\"", StringUtils.addQuotesIfNecessary("ab cd")); assertEquals("\"ab cd\"", StringUtils.addQuotesIfNecessary("\"ab cd\"")); }