StringUtils { public static String removeSurroundingQuotes(String string) { if (string.length() >= 2 && string.charAt(0) == '"' && string.charAt(string.length() - 1) == '"') { string = string.substring(1, string.length() - 1); } return string; } private  StringUtils(); static String removeSurroundingQuotes(String string); static boolean emptyString(final String str); static String formatInsulin(double insulin);  }
@Test public void removeSurroundingQuotesTest() { String compareString = "test"; assertEquals(compareString, StringUtils.removeSurroundingQuotes(compareString)); assertEquals(compareString, StringUtils.removeSurroundingQuotes("\"" + compareString + "\"")); assertEquals("\"" + compareString, StringUtils.removeSurroundingQuotes("\"" + compareString)); compareString = "te\"st"; assertEquals(compareString, StringUtils.removeSurroundingQuotes(compareString)); assertEquals(compareString, StringUtils.removeSurroundingQuotes("\"" + compareString + "\"")); assertEquals("\"" + compareString, StringUtils.removeSurroundingQuotes("\"" + compareString)); }