@Test public void testJoinSingleItem() { String joined = ParseTextUtils.join(",", Collections.singletonList("one")); assertEquals("one", joined); }
static String join(CharSequence delimiter, Iterable tokens) { StringBuilder sb = new StringBuilder(); boolean firstTime = true; for (Object item : tokens) { if (firstTime) { firstTime = false; } else { sb.append(delimiter); } sb.append(item); } return sb.toString(); }
ParseTextUtils { static String join(CharSequence delimiter, Iterable tokens) { StringBuilder sb = new StringBuilder(); boolean firstTime = true; for (Object item : tokens) { if (firstTime) { firstTime = false; } else { sb.append(delimiter); } sb.append(item); } return sb.toString(); } }
ParseTextUtils { static String join(CharSequence delimiter, Iterable tokens) { StringBuilder sb = new StringBuilder(); boolean firstTime = true; for (Object item : tokens) { if (firstTime) { firstTime = false; } else { sb.append(delimiter); } sb.append(item); } return sb.toString(); } private  ParseTextUtils(); }
ParseTextUtils { static String join(CharSequence delimiter, Iterable tokens) { StringBuilder sb = new StringBuilder(); boolean firstTime = true; for (Object item : tokens) { if (firstTime) { firstTime = false; } else { sb.append(delimiter); } sb.append(item); } return sb.toString(); } private  ParseTextUtils(); static boolean isEmpty(CharSequence text); static boolean equals(CharSequence a, CharSequence b); }
ParseTextUtils { static String join(CharSequence delimiter, Iterable tokens) { StringBuilder sb = new StringBuilder(); boolean firstTime = true; for (Object item : tokens) { if (firstTime) { firstTime = false; } else { sb.append(delimiter); } sb.append(item); } return sb.toString(); } private  ParseTextUtils(); static boolean isEmpty(CharSequence text); static boolean equals(CharSequence a, CharSequence b);  }