/** * Reverses the elements of {@code array}. This is equivalent to {@code * Collections.reverse(Booleans.asList(array))}, but is likely to be more efficient. * * @since 23.1 */ public static void reverse(boolean[] array) { checkNotNull(array); reverse(array, 0, array.length); }
/** * Reverses the elements of {@code array}. This is equivalent to {@code * Collections.reverse(Booleans.asList(array))}, but is likely to be more efficient. * * @since 23.1 */ public static void reverse(boolean[] array) { checkNotNull(array); reverse(array, 0, array.length); }
/** * Reverses the elements of {@code array}. This is equivalent to {@code * Collections.reverse(Booleans.asList(array))}, but is likely to be more efficient. * * @since 23.1 */ public static void reverse(boolean[] array) { checkNotNull(array); reverse(array, 0, array.length); }
private static void testReverse(boolean[] input, boolean[] expectedOutput) { input = Arrays.copyOf(input, input.length); Booleans.reverse(input); assertTrue(Arrays.equals(expectedOutput, input)); }
private static void testReverse( boolean[] input, int fromIndex, int toIndex, boolean[] expectedOutput) { input = Arrays.copyOf(input, input.length); Booleans.reverse(input, fromIndex, toIndex); assertTrue(Arrays.equals(expectedOutput, input)); }
/** * Reverses the elements of {@code array}. This is equivalent to {@code * Collections.reverse(Booleans.asList(array))}, but is likely to be more efficient. * * @since 23.1 */ public static void reverse(boolean[] array) { checkNotNull(array); reverse(array, 0, array.length); }
/** * Reverses the elements of {@code array}. This is equivalent to {@code * Collections.reverse(Booleans.asList(array))}, but is likely to be more efficient. * * @since 23.1 */ public static void reverse(boolean[] array) { checkNotNull(array); reverse(array, 0, array.length); }
private static void testReverse(boolean[] input, boolean[] expectedOutput) { input = Arrays.copyOf(input, input.length); Booleans.reverse(input); assertTrue(Arrays.equals(expectedOutput, input)); }
private static void testReverse( boolean[] input, int fromIndex, int toIndex, boolean[] expectedOutput) { input = Arrays.copyOf(input, input.length); Booleans.reverse(input, fromIndex, toIndex); assertTrue(Arrays.equals(expectedOutput, input)); }