2
2
3
3
import com .fishercoder .common .classes .ListNode ;
4
4
import com .fishercoder .common .utils .LinkedListUtils ;
5
- import com .fishercoder .solutions ._1 ;
6
- import com .fishercoder .solutions ._1669 ;
7
5
import org .junit .BeforeClass ;
6
+ import org .junit .Test ;import org .junit .BeforeClass ;
8
7
import org .junit .Test ;
9
-
10
- import static org .junit .Assert .assertArrayEquals ;
11
- import static org .junit .Assert .assertEquals ;
8
+ import com .fishercoder .solutions ._1669 ;
12
9
13
10
public class _1669Test {
14
11
private static _1669 .Solution1 solution1 ;
12
+ private static _1669 .Solution1 solution2 ;
13
+ private static ListNode l1 ;
14
+ private static ListNode l2 ;
15
+ private static int a ;
16
+ private static int b ;
15
17
private static ListNode list1 ;
16
18
private static ListNode list2 ;
17
19
private static ListNode expected ;
@@ -20,6 +22,7 @@ public class _1669Test {
20
22
@ BeforeClass
21
23
public static void setup () {
22
24
solution1 = new _1669 .Solution1 ();
25
+ solution2 = new _1669 .Solution2 ();
23
26
}
24
27
25
28
@ Test
@@ -31,5 +34,12 @@ public void test1() {
31
34
LinkedListUtils .printList (actual );
32
35
assertEquals (expected , actual );
33
36
}
34
-
35
- }
37
+ @ Test
38
+ public void test2 () {
39
+ l1 = ListNode .createSinglyLinkedList (Arrays .asList (0 , 1 , 2 , 3 , 4 , 5 ));
40
+ l2 = ListNode .createSinglyLinkedList (Arrays .asList (1000000 ,1000001 ,1000002 ));
41
+ a = 3 ;
42
+ b = 4 ;
43
+ assertEquals (ListNode .createSinglyLinkedList (Arrays .asList (0 ,1 ,2 ,1000000 ,1000001 ,1000002 ,5 )), solution2 .mergeInBetween (l1 , a , b , l2 ));
44
+ }
45
+ }
0 commit comments