You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
returnStream.of(Arguments.of(newInteger[] {1, 2, 3, 4}, 1, 2, newInteger[] {1, 3, 2, 4}, "Swapping adjacent elements should work correctly."), Arguments.of(newInteger[] {1, 2, 3, 4}, 0, 3, newInteger[] {4, 2, 3, 1}, "Swapping non-adjacent elements should work correctly."),
86
-
Arguments.of(newInteger[] {1, 2, 3, 4}, 2, 2, newInteger[] {1, 2, 3, 4}, "Swapping the same index should not change the array."), Arguments.of(newString[] {"a", "b", "c", "d"}, 0, 3, newString[] {"d", "b", "c", "a"}, "Swapping first and last elements should work correctly."),
87
-
Arguments.of(newString[] {null, "b", "c", null}, 0, 3, newString[] {null, "b", "c", null}, "Swapping null elements should work correctly."), Arguments.of(newInteger[] {}, 0, 0, newInteger[] {}, "Swapping in an empty array should not throw an error."));
86
+
Arguments.of(newInteger[] {1, 2, 3, 4}, 2, 2, newInteger[] {1, 2, 3, 4}, "Swapping the same index should not change the array."), Arguments.of(newString[] {"a", "b", "c", "d"}, 0, 3, newString[] {"d", "b", "c", "a"}, "Swapping first and last elements should work correctly."),
87
+
Arguments.of(newString[] {null, "b", "c", null}, 0, 3, newString[] {null, "b", "c", null}, "Swapping null elements should work correctly."), Arguments.of(newInteger[] {}, 0, 0, newInteger[] {}, "Swapping in an empty array should not throw an error."));
88
88
}
89
89
90
90
@Test
91
91
publicvoidtestSwapOutOfBounds() {
92
92
Integer[] array = {1, 2, 3, 4};
93
-
assertThrows(ArrayIndexOutOfBoundsException.class, () -> { SortUtils.swap(array, -1, 4); }, "Swapping out of bounds should throw an ArrayIndexOutOfBoundsException.");
93
+
assertThrows(ArrayIndexOutOfBoundsException.class, () -> SortUtils.swap(array, -1, 4), "Swapping out of bounds should throw an ArrayIndexOutOfBoundsException.");
0 commit comments