99public class _14Test {
1010 private static _14 .Solution1 solution1 ;
1111 private static _14 .Solution2 solution2 ;
12- private static _14 .Solution3 solution3 ;
1312 private static String [] strs ;
1413
1514 @ BeforeClass
1615 public static void setup () {
1716 solution1 = new _14 .Solution1 ();
1817 solution2 = new _14 .Solution2 ();
19- solution3 = new _14 .Solution3 ();
2018 }
2119
2220 @ Test
2321 public void test1 () {
2422 strs = new String []{"a" , "b" };
2523 assertEquals ("" , solution1 .longestCommonPrefix (strs ));
2624 assertEquals ("" , solution2 .longestCommonPrefix (strs ));
27- assertEquals ("" , solution3 .longestCommonPrefix (strs ));
2825 }
2926
3027 @ Test
3128 public void test2 () {
3229 strs = new String []{"leetcode" , "lead" };
3330 assertEquals ("le" , solution1 .longestCommonPrefix (strs ));
3431 assertEquals ("le" , solution2 .longestCommonPrefix (strs ));
35- assertEquals ("le" , solution3 .longestCommonPrefix (strs ));
3632 }
3733
3834 @ Test
3935 public void test3 () {
4036 strs = new String []{"leetcode" , "code" };
4137 assertEquals ("" , solution1 .longestCommonPrefix (strs ));
4238 assertEquals ("" , solution2 .longestCommonPrefix (strs ));
43- assertEquals ("" , solution3 .longestCommonPrefix (strs ));
39+ }
40+
41+ @ Test
42+ public void test4 () {
43+ strs = new String []{"flower" , "flow" , "flight" };
44+ assertEquals ("fl" , solution1 .longestCommonPrefix (strs ));
45+ assertEquals ("fl" , solution2 .longestCommonPrefix (strs ));
46+ }
47+
48+ @ Test
49+ public void test5 () {
50+ strs = new String []{};
51+ assertEquals ("" , solution1 .longestCommonPrefix (strs ));
52+ assertEquals ("" , solution2 .longestCommonPrefix (strs ));
53+ }
54+
55+ @ Test
56+ public void test6 () {
57+ strs = new String []{"a" };
58+ assertEquals ("a" , solution1 .longestCommonPrefix (strs ));
59+ assertEquals ("a" , solution2 .longestCommonPrefix (strs ));
60+ }
61+
62+ @ Test
63+ public void test7 () {
64+ strs = new String []{"c" , "c" };
65+ assertEquals ("c" , solution1 .longestCommonPrefix (strs ));
66+ assertEquals ("c" , solution2 .longestCommonPrefix (strs ));
4467 }
4568
4669}
0 commit comments