22
33import com .fishercoder .common .classes .ListNode ;
44import com .fishercoder .common .utils .LinkedListUtils ;
5- import com .fishercoder .solutions ._1 ;
6- import com .fishercoder .solutions ._1669 ;
75import org .junit .BeforeClass ;
6+ import org .junit .Test ;import org .junit .BeforeClass ;
87import org .junit .Test ;
9-
10- import static org .junit .Assert .assertArrayEquals ;
11- import static org .junit .Assert .assertEquals ;
8+ import com .fishercoder .solutions ._1669 ;
129
1310public class _1669Test {
1411 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 ;
1517 private static ListNode list1 ;
1618 private static ListNode list2 ;
1719 private static ListNode expected ;
@@ -20,6 +22,7 @@ public class _1669Test {
2022 @ BeforeClass
2123 public static void setup () {
2224 solution1 = new _1669 .Solution1 ();
25+ solution2 = new _1669 .Solution2 ();
2326 }
2427
2528 @ Test
@@ -31,5 +34,12 @@ public void test1() {
3134 LinkedListUtils .printList (actual );
3235 assertEquals (expected , actual );
3336 }
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