TaskHelper { public static String join(double[] array, char separator) { return join(array, separator, 0, array.length - 1); }  static String join(double[] array, char separator); static String join(double[] array, char separator, int startIndex, int endIndex); static String join(int[] array, char separator); static String join(int[] array, char separator, int startIndex, int endIndex); static String join(Number[] array, char separator); static String join(Number[] array, char separator, int startIndex, int endIndex); static Date nextMonthStart(Date period); static Date thisHour(Date period); static Date todayZero(Date period); static Date tomorrowZero(Date period); static Date yesterdayZero(Date period);  }
@Test public void testJoinIntArrayChar() { Assert.assertEquals("1,2", TaskHelper.join(new int[] { 1, 2 }, ',')); }
@Test public void testJoinIntArray() { final int[] array = {1, -8, -7, -7, -7, -7, -7, -253968, -7, -24, -24, -2147475464, 4088, -2147483647, 9, 33505273, 1, -8}; Assert.assertNull(TaskHelper.join((int[]) null, '1', 2, 3)); Assert.assertEquals("", TaskHelper.join(new int[0], '\u0000', 24, 5)); Assert.assertEquals("", TaskHelper.join(new int[0], '\u0000')); Assert.assertEquals("1\u0000-8", TaskHelper.join(array, '\u0000', 16, 17)); }
@Test public void testJoinDoubleArray() { Assert.assertNull(TaskHelper.join((double[]) null, '1', 2, 3)); Assert.assertEquals("", TaskHelper.join(new double[]{5.1}, '\u0000')); Assert.assertEquals("2.1\u00004.5", TaskHelper.join(new double[]{2.1, 4.5}, '\u0000')); Assert.assertEquals("", TaskHelper.join(new double[]{5.1, 9.2}, '\u0000', 119, 96)); }
@Test public void testJoinNumberArray() { Assert.assertNull(TaskHelper.join((Number[]) null, '1', 2, 3)); Assert.assertEquals("", TaskHelper.join(new Number[0], '\u0000')); Assert.assertEquals("-100\u0000-891", TaskHelper.join(new Number[]{-100, -891}, '\u0000', 0, 1)); Assert.assertEquals("", TaskHelper.join(new Number[0], '\u0000', 139, -1744)); }
@Test public void testJoinThrowsException1() { thrown.expect(ArrayIndexOutOfBoundsException.class); TaskHelper.join(new Number[0], '\u0000', 112, 1071); }
@Test public void testJoinThrowsException2() { thrown.expect(ArrayIndexOutOfBoundsException.class); TaskHelper.join(new Number[]{-100, -891}, '\u0000', 0, 114); }