@Test public void testImplodeCollectionWithSeperator() { String seperator = ","; String nullSeperator = null; List<Integer> testInput = Arrays.asList(1, 2, 3, 4, 5, 6, 7); List<String> nullTestInput = null; String actualResult; String expectedResult_01 = "1,2,3,4,5,6,7"; String expectedResult_02 = "1null2null3null4null5null6null7"; String expectedResult_03 = ""; actualResult = CollectionUtil.implode(testInput, seperator); assertNotNull(actualResult); assertThat(actualResult, is(expectedResult_01)); assertEquals(expectedResult_01, actualResult); actualResult = CollectionUtil.implode(testInput, nullSeperator); assertNotNull(actualResult); assertThat(actualResult, is(expectedResult_02)); assertEquals(expectedResult_02, actualResult); actualResult = CollectionUtil.implode(nullTestInput, nullSeperator); assertNotNull(actualResult); assertThat(actualResult, is(expectedResult_03)); assertEquals(expectedResult_03, actualResult); }
public static <T> String implode(Collection<T> collection) { return implode(collection, ",", new Stringifier<T>() { public String execute(T obj, Object... args) { return obj.toString(); } }); }
CollectionUtil { public static <T> String implode(Collection<T> collection) { return implode(collection, ",", new Stringifier<T>() { public String execute(T obj, Object... args) { return obj.toString(); } }); } }
CollectionUtil { public static <T> String implode(Collection<T> collection) { return implode(collection, ",", new Stringifier<T>() { public String execute(T obj, Object... args) { return obj.toString(); } }); }  }
CollectionUtil { public static <T> String implode(Collection<T> collection) { return implode(collection, ",", new Stringifier<T>() { public String execute(T obj, Object... args) { return obj.toString(); } }); }  static boolean isEmpty(Collection<?> collection); static boolean hasElements(Collection<?> collection); static List<String> stringify(Collection<T> collection); static List<String> stringify(Collection<T> collection, Stringifier<T> stringifier,
			Object... options); static String implode(Collection<T> collection); static String implode(Collection<T> collection, String separator); static String implode(Collection<T> collection, Stringifier<T> stringifier,
			Object... options); static String implode(Collection<T> collection, String sep,
			Stringifier<T> stringifier, Object... options); }
CollectionUtil { public static <T> String implode(Collection<T> collection) { return implode(collection, ",", new Stringifier<T>() { public String execute(T obj, Object... args) { return obj.toString(); } }); }  static boolean isEmpty(Collection<?> collection); static boolean hasElements(Collection<?> collection); static List<String> stringify(Collection<T> collection); static List<String> stringify(Collection<T> collection, Stringifier<T> stringifier,
			Object... options); static String implode(Collection<T> collection); static String implode(Collection<T> collection, String separator); static String implode(Collection<T> collection, Stringifier<T> stringifier,
			Object... options); static String implode(Collection<T> collection, String sep,
			Stringifier<T> stringifier, Object... options);  }