StringUtils { public static String getStringOrEmpty(String inputString) { if (isEmpty(inputString)) { return ""; } else { return trim(inputString); } } private  StringUtils(); static boolean isEmpty(CharSequence cs); static boolean isNotEmpty(CharSequence cs); static boolean isNotEmptyTrimmed(String str); static String trim(String str); static String getStringOrEmpty(String inputString); static String getStringOrDefault(String inputString, String def); static String replaceWildcardConfigs(String contentWithWildcards, Map<String, Object> properties);  }
@Test public void testGetStringOrEmpty(TestContext context){ context.assertEquals(empty, StringUtils.getStringOrEmpty(null)); context.assertEquals(empty, StringUtils.getStringOrEmpty("")); context.assertEquals(empty, StringUtils.getStringOrEmpty(" ")); context.assertEquals(text, StringUtils.getStringOrEmpty(text)); context.assertEquals(text, StringUtils.getStringOrEmpty(" " + text + " ")); }