@@ -18,11 +18,7 @@ void testNearestGreaterToRight(int[] input, int[] expected) {
1818 }
1919
2020 static Stream <Arguments > provideGreaterToRightTestCases () {
21- return Stream .of (
22- Arguments .of (new int [] {4 , 5 , 2 , 10 , 8 }, new int [] {5 , 10 , 10 , -1 , -1 }),
23- Arguments .of (new int [] {5 }, new int [] {-1 }),
24- Arguments .of (new int [] {}, new int [] {})
25- );
21+ return Stream .of (Arguments .of (new int [] {4 , 5 , 2 , 10 , 8 }, new int [] {5 , 10 , 10 , -1 , -1 }), Arguments .of (new int [] {5 }, new int [] {-1 }), Arguments .of (new int [] {}, new int [] {}));
2622 }
2723
2824 @ ParameterizedTest
@@ -32,11 +28,7 @@ void testNearestGreaterToLeft(int[] input, int[] expected) {
3228 }
3329
3430 static Stream <Arguments > provideGreaterToLeftTestCases () {
35- return Stream .of (
36- Arguments .of (new int [] {4 , 5 , 2 , 10 , 8 }, new int [] {-1 , -1 , 5 , -1 , 10 }),
37- Arguments .of (new int [] {5 }, new int [] {-1 }),
38- Arguments .of (new int [] {}, new int [] {})
39- );
31+ return Stream .of (Arguments .of (new int [] {4 , 5 , 2 , 10 , 8 }, new int [] {-1 , -1 , 5 , -1 , 10 }), Arguments .of (new int [] {5 }, new int [] {-1 }), Arguments .of (new int [] {}, new int [] {}));
4032 }
4133
4234 @ ParameterizedTest
@@ -46,11 +38,7 @@ void testNearestSmallerToRight(int[] input, int[] expected) {
4638 }
4739
4840 static Stream <Arguments > provideSmallerToRightTestCases () {
49- return Stream .of (
50- Arguments .of (new int [] {4 , 5 , 2 , 10 , 8 }, new int [] {2 , 2 , -1 , 8 , -1 }),
51- Arguments .of (new int [] {5 }, new int [] {-1 }),
52- Arguments .of (new int [] {}, new int [] {})
53- );
41+ return Stream .of (Arguments .of (new int [] {4 , 5 , 2 , 10 , 8 }, new int [] {2 , 2 , -1 , 8 , -1 }), Arguments .of (new int [] {5 }, new int [] {-1 }), Arguments .of (new int [] {}, new int [] {}));
5442 }
5543
5644 @ ParameterizedTest
@@ -60,11 +48,7 @@ void testNearestSmallerToLeft(int[] input, int[] expected) {
6048 }
6149
6250 static Stream <Arguments > provideSmallerToLeftTestCases () {
63- return Stream .of (
64- Arguments .of (new int [] {4 , 5 , 2 , 10 , 8 }, new int [] {-1 , 4 , -1 , 2 , 2 }),
65- Arguments .of (new int [] {5 }, new int [] {-1 }),
66- Arguments .of (new int [] {}, new int [] {})
67- );
51+ return Stream .of (Arguments .of (new int [] {4 , 5 , 2 , 10 , 8 }, new int [] {-1 , 4 , -1 , 2 , 2 }), Arguments .of (new int [] {5 }, new int [] {-1 }), Arguments .of (new int [] {}, new int [] {}));
6852 }
6953
7054 @ Test
@@ -74,4 +58,4 @@ void testNullInput() {
7458 assertThrows (IllegalArgumentException .class , () -> NearestElement .nearestSmallerToRight (null ));
7559 assertThrows (IllegalArgumentException .class , () -> NearestElement .nearestSmallerToLeft (null ));
7660 }
77- }
61+ }
0 commit comments