@@ -37,46 +37,26 @@ void testEdgeCases(int data, int posA, int posB, int expected) {
3737 @ ParameterizedTest (name = "Invalid positions: data={0}, posA={1}, posB={2} should throw" )
3838 @ MethodSource ("provideInvalidPositions" )
3939 void invalidPositionThrowsException (int data , int posA , int posB ) {
40- assertThrows (IllegalArgumentException .class ,
41- () -> BitSwap .bitSwap (data , posA , posB ));
40+ assertThrows (IllegalArgumentException .class , () -> BitSwap .bitSwap (data , posA , posB ));
4241 }
4342
4443 static Stream <Arguments > provideAdditionalCases () {
45- return Stream .of (
46- Arguments .of (3 , 0 , 1 , 3 ),
47- Arguments .of (6 , 0 , 1 , 5 ),
48- Arguments .of (7 , 1 , 1 , 7 )
49- );
44+ return Stream .of (Arguments .of (3 , 0 , 1 , 3 ), Arguments .of (6 , 0 , 1 , 5 ), Arguments .of (7 , 1 , 1 , 7 ));
5045 }
5146
5247 static Stream <Arguments > provideDifferentBitsCases () {
53- return Stream .of (
54- Arguments .of (0b01, 0 , 1 , 0b10)
55- );
48+ return Stream .of (Arguments .of (0b01, 0 , 1 , 0b10));
5649 }
5750
5851 static Stream <Arguments > provideSameBitsCases () {
59- return Stream .of (
60- Arguments .of (0b111, 0 , 2 ),
61- Arguments .of (0b0, 1 , 3 ),
62- Arguments .of (0b1010, 1 , 3 ),
63- Arguments .of (-1 , 5 , 5 )
64- );
52+ return Stream .of (Arguments .of (0b111, 0 , 2 ), Arguments .of (0b0, 1 , 3 ), Arguments .of (0b1010, 1 , 3 ), Arguments .of (-1 , 5 , 5 ));
6553 }
6654
6755 static Stream <Arguments > provideEdgeCases () {
68- return Stream .of (
69- Arguments .of (Integer .MIN_VALUE , 31 , 0 , 1 ),
70- Arguments .of (0 , 0 , 31 , 0 )
71- );
56+ return Stream .of (Arguments .of (Integer .MIN_VALUE , 31 , 0 , 1 ), Arguments .of (0 , 0 , 31 , 0 ));
7257 }
7358
7459 static Stream <Arguments > provideInvalidPositions () {
75- return Stream .of (
76- Arguments .of (0 , -1 , 0 ),
77- Arguments .of (0 , 0 , 32 ),
78- Arguments .of (0 , -5 , 33 ),
79- Arguments .of (0 , Integer .MIN_VALUE , Integer .MAX_VALUE )
80- );
60+ return Stream .of (Arguments .of (0 , -1 , 0 ), Arguments .of (0 , 0 , 32 ), Arguments .of (0 , -5 , 33 ), Arguments .of (0 , Integer .MIN_VALUE , Integer .MAX_VALUE ));
8161 }
8262}
0 commit comments