@@ -8,38 +8,40 @@ public class ArrayRotationTest {
88
99 @ Test
1010 void shouldRotateArrayRightByTwoPositions () {
11- int [] values = {1 , 2 , 3 , 4 , 5 };
11+ int [] values = { 1 , 2 , 3 , 4 , 5 };
1212
1313 ArrayRotation .rotateRight (values , 2 );
1414
15- assertArrayEquals (new int [] {4 , 5 , 1 , 2 , 3 }, values );
15+ assertArrayEquals (new int [] { 4 , 5 , 1 , 2 , 3 }, values );
16+
1617 }
1718
1819 @ Test
1920 void shouldRotateArrayLeftByTwoPositions () {
20- int [] values = {1 , 2 , 3 , 4 , 5 };
21+ int [] values = { 1 , 2 , 3 , 4 , 5 };
2122
2223 ArrayRotation .rotateLeft (values , 2 );
2324
24- assertArrayEquals (new int [] {3 , 4 , 5 , 1 , 2 }, values );
25+ assertArrayEquals (new int [] { 3 , 4 , 5 , 1 , 2 }, values );
26+
2527 }
2628
2729 @ Test
2830 void shouldHandleRotationGreaterThanArrayLength () {
29- int [] values = {10 , 20 , 30 , 40 };
31+ int [] values = { 10 , 20 , 30 , 40 };
3032
31- ArrayRotation .rotateRight (values , 6 );
33+ ArrayRotation .rotateRight (values , 2 );
3234
33- assertArrayEquals (new int [] {30 , 40 , 10 , 20 }, values );
35+ assertArrayEquals (new int [] { 30 , 40 , 10 , 20 }, values );
3436 }
3537
3638 @ Test
3739 void shouldKeepSingleElementArrayUnchanged () {
38- int [] values = {99 };
40+ int [] values = { 99 };
3941
4042 ArrayRotation .rotateLeft (values , 5 );
4143
42- assertArrayEquals (new int [] {99 }, values );
44+ assertArrayEquals (new int [] { 99 }, values );
4345 }
4446
4547 @ Test
@@ -53,11 +55,10 @@ void shouldHandleEmptyArrayWithoutErrors() {
5355
5456 @ Test
5557 void shouldReturnOriginalArrayWhenRotationIsZero () {
56- int [] values = {7 , 8 , 9 };
58+ int [] values = { 7 , 8 , 9 };
5759
5860 ArrayRotation .rotateLeft (values , 0 );
5961
60- assertArrayEquals (new int [] {7 , 8 , 9 }, values );
62+ assertArrayEquals (new int [] { 7 , 8 , 9 }, values );
6163 }
62- }
63-
64+ }
0 commit comments