@@ -37,46 +37,26 @@ void testEdgeCases(int data, int posA, int posB, int expected) {
37
37
@ ParameterizedTest (name = "Invalid positions: data={0}, posA={1}, posB={2} should throw" )
38
38
@ MethodSource ("provideInvalidPositions" )
39
39
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 ));
42
41
}
43
42
44
43
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 ));
50
45
}
51
46
52
47
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));
56
49
}
57
50
58
51
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 ));
65
53
}
66
54
67
55
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 ));
72
57
}
73
58
74
59
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 ));
81
61
}
82
62
}
0 commit comments