Skip to content

Commit c578359

Browse files
author
Alex Klymenko
committed
Checkstyle: fix formatting
1 parent 57fddd1 commit c578359

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/test/java/com/thealgorithms/sorts/SortUtilsTest.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
import java.util.List;
99
import java.util.stream.Stream;
10-
1110
import org.junit.jupiter.api.Test;
1211
import org.junit.jupiter.params.ParameterizedTest;
1312
import org.junit.jupiter.params.provider.Arguments;
@@ -83,15 +82,14 @@ public <T> void testSwap(T[] array, int i, int j, T[] expected, String message)
8382
}
8483

8584
private static Stream<Arguments> provideArraysForSwap() {
86-
return Stream.of(Arguments.of(new Integer[]{1, 2, 3, 4}, 1, 2, new Integer[]{1, 3, 2, 4}, "Swapping adjacent elements should work correctly."), Arguments.of(new Integer[]{1, 2, 3, 4}, 0, 3, new Integer[]{4, 2, 3, 1}, "Swapping non-adjacent elements should work correctly."), Arguments.of(new Integer[]{1, 2, 3, 4}, 2, 2, new Integer[]{1, 2, 3, 4}, "Swapping the same index should not change the array."),
87-
Arguments.of(new String[]{"a", "b", "c", "d"}, 0, 3, new String[]{"d", "b", "c", "a"}, "Swapping first and last elements should work correctly."), Arguments.of(new String[]{null, "b", "c", null}, 0, 3, new String[]{null, "b", "c", null}, "Swapping null elements should work correctly."), Arguments.of(new Integer[]{}, 0, 0, new Integer[]{}, "Swapping in an empty array should not throw an error."));
85+
return Stream.of(Arguments.of(new Integer[] {1, 2, 3, 4}, 1, 2, new Integer[] {1, 3, 2, 4}, "Swapping adjacent elements should work correctly."), Arguments.of(new Integer[] {1, 2, 3, 4}, 0, 3, new Integer[] {4, 2, 3, 1}, "Swapping non-adjacent elements should work correctly."),
86+
Arguments.of(new Integer[] {1, 2, 3, 4}, 2, 2, new Integer[] {1, 2, 3, 4}, "Swapping the same index should not change the array."), Arguments.of(new String[] {"a", "b", "c", "d"}, 0, 3, new String[] {"d", "b", "c", "a"}, "Swapping first and last elements should work correctly."),
87+
Arguments.of(new String[] {null, "b", "c", null}, 0, 3, new String[] {null, "b", "c", null}, "Swapping null elements should work correctly."), Arguments.of(new Integer[] {}, 0, 0, new Integer[] {}, "Swapping in an empty array should not throw an error."));
8888
}
8989

9090
@Test
9191
public void testSwapOutOfBounds() {
9292
Integer[] array = {1, 2, 3, 4};
93-
assertThrows(ArrayIndexOutOfBoundsException.class, () -> {
94-
SortUtils.swap(array, -1, 4);
95-
}, "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.");
9694
}
9795
}

0 commit comments

Comments
 (0)