@Test public void testStringifyTArrayStringifierOptionalObjs() { Integer int1 = Integer.valueOf(1); Integer int2 = Integer.valueOf(2); Integer int3 = Integer.valueOf(3); Integer int4 = Integer.valueOf(4); Integer int5 = Integer.valueOf(5); Object[] inputArray = {int1, int2, int3, int4, int5}; String[] expectedResult = {"1", "2", "3", "4", "5"}; @SuppressWarnings("unchecked") Stringifier<Object> callback = mock(Stringifier.class); when(callback.execute(inputArray[0], "")).thenReturn("1"); when(callback.execute(inputArray[1], "")).thenReturn("2"); when(callback.execute(inputArray[2], "")).thenReturn("3"); when(callback.execute(inputArray[3], "")).thenReturn("4"); when(callback.execute(inputArray[4], "")).thenReturn("5"); String[] actualResult = ArrayUtil.stringify(inputArray); assertNotNull(actualResult); assertTrue(actualResult instanceof String[]); assertArrayEquals(expectedResult, actualResult); }
public static <T> String[] stringify(T[] array) { return stringify(array, new Stringifier<T>() { public String execute(T obj, Object... args) { return obj == null ? StringUtil.EMPTY : obj.toString(); } }); }
ArrayUtil { public static <T> String[] stringify(T[] array) { return stringify(array, new Stringifier<T>() { public String execute(T obj, Object... args) { return obj == null ? StringUtil.EMPTY : obj.toString(); } }); } }
ArrayUtil { public static <T> String[] stringify(T[] array) { return stringify(array, new Stringifier<T>() { public String execute(T obj, Object... args) { return obj == null ? StringUtil.EMPTY : obj.toString(); } }); } private  ArrayUtil(); }
ArrayUtil { public static <T> String[] stringify(T[] array) { return stringify(array, new Stringifier<T>() { public String execute(T obj, Object... args) { return obj == null ? StringUtil.EMPTY : obj.toString(); } }); } private  ArrayUtil(); static Integer[] box(int[] ints); @SuppressWarnings("unchecked") static T[] toArray(Enumeration<T> e); static String[] stringify(T[] array); static String[] stringify(Collection<T> collection); static String[] stringify(T[] array, Stringifier<T> stringifier, Object... options); static String[] stringify(Collection<T> collection, Stringifier<T> stringifier,
			Object... options); static String[] translate(String[] array, Translator translator); static String[] translate(String[] strings, Translator translator, boolean overwrite,
			Object... options); static Object[] convert(Object[] array, RawConverter converter); static Object[] convert(Object[] objects, RawConverter converter, boolean overwrite,
			Object... options); static U[] convert(T[] objects, Converter<T, U> converter, Object... options); static String[] concat(String[]... arrays); static Object[] concat(Object[]... arrays); @SafeVarargs static boolean in(T obj, T... objs); static boolean in(char c, char... chars); @SafeVarargs static boolean has(T obj, T... objs); static String implode(T[] objects); static String implode(T[] objects, String separator); static String implode(T[] objects, Stringifier<T> callback, Object... options); static String implode(T[] objects, String separator, Stringifier<T> callback,
			Object... options); static boolean deepEquals(byte[] array1, byte[] array2); }
ArrayUtil { public static <T> String[] stringify(T[] array) { return stringify(array, new Stringifier<T>() { public String execute(T obj, Object... args) { return obj == null ? StringUtil.EMPTY : obj.toString(); } }); } private  ArrayUtil(); static Integer[] box(int[] ints); @SuppressWarnings("unchecked") static T[] toArray(Enumeration<T> e); static String[] stringify(T[] array); static String[] stringify(Collection<T> collection); static String[] stringify(T[] array, Stringifier<T> stringifier, Object... options); static String[] stringify(Collection<T> collection, Stringifier<T> stringifier,
			Object... options); static String[] translate(String[] array, Translator translator); static String[] translate(String[] strings, Translator translator, boolean overwrite,
			Object... options); static Object[] convert(Object[] array, RawConverter converter); static Object[] convert(Object[] objects, RawConverter converter, boolean overwrite,
			Object... options); static U[] convert(T[] objects, Converter<T, U> converter, Object... options); static String[] concat(String[]... arrays); static Object[] concat(Object[]... arrays); @SafeVarargs static boolean in(T obj, T... objs); static boolean in(char c, char... chars); @SafeVarargs static boolean has(T obj, T... objs); static String implode(T[] objects); static String implode(T[] objects, String separator); static String implode(T[] objects, Stringifier<T> callback, Object... options); static String implode(T[] objects, String separator, Stringifier<T> callback,
			Object... options); static boolean deepEquals(byte[] array1, byte[] array2);  }