@@ -9,32 +9,21 @@ class AccountMergeTest {
99
1010 @ Test
1111 void testMergeAccountsWithSharedEmails () {
12- List <List <String >> accounts = List .of (
13- List .of ("abc" , "abc@mail.com" , "abx@mail.com" ),
14- List .of ("abc" , "abc@mail.com" , "aby@mail.com" ),
15- List .of ("Mary" , "mary@mail.com" ),
16- List .of ("John" , "johnnybravo@mail.com" ));
12+ List <List <String >> accounts = List .of (List .of ("abc" , "abc@mail.com" , "abx@mail.com" ), List .of ("abc" , "abc@mail.com" , "aby@mail.com" ), List .of ("Mary" , "mary@mail.com" ), List .of ("John" , "johnnybravo@mail.com" ));
1713
1814 List <List <String >> merged = AccountMerge .mergeAccounts (accounts );
1915
20- List <List <String >> expected = List .of (
21- List .of ("John" , "johnnybravo@mail.com" ),
22- List .of ("Mary" , "mary@mail.com" ),
23- List .of ("abc" , "abc@mail.com" , "abx@mail.com" , "aby@mail.com" ));
16+ List <List <String >> expected = List .of (List .of ("John" , "johnnybravo@mail.com" ), List .of ("Mary" , "mary@mail.com" ), List .of ("abc" , "abc@mail.com" , "abx@mail.com" , "aby@mail.com" ));
2417
2518 assertEquals (expected , merged );
2619 }
2720
2821 @ Test
2922 void testAccountsWithSameNameButNoSharedEmailStaySeparate () {
30- List <List <String >> accounts = List .of (
31- List .of ("Alex" , "alex1@mail.com" ),
32- List .of ("Alex" , "alex2@mail.com" ));
23+ List <List <String >> accounts = List .of (List .of ("Alex" , "alex1@mail.com" ), List .of ("Alex" , "alex2@mail.com" ));
3324
3425 List <List <String >> merged = AccountMerge .mergeAccounts (accounts );
35- List <List <String >> expected = List .of (
36- List .of ("Alex" , "alex1@mail.com" ),
37- List .of ("Alex" , "alex2@mail.com" ));
26+ List <List <String >> expected = List .of (List .of ("Alex" , "alex1@mail.com" ), List .of ("Alex" , "alex2@mail.com" ));
3827
3928 assertEquals (expected , merged );
4029 }
@@ -51,31 +40,21 @@ void testNullInput() {
5140
5241 @ Test
5342 void testTransitiveMergeAndDuplicateEmails () {
54- List <List <String >> accounts = List .of (
55- List .of ("A" , "a1@mail.com" , "a2@mail.com" ),
56- List .of ("A" , "a2@mail.com" , "a3@mail.com" ),
57- List .of ("A" , "a3@mail.com" , "a4@mail.com" , "a4@mail.com" ));
43+ List <List <String >> accounts = List .of (List .of ("A" , "a1@mail.com" , "a2@mail.com" ), List .of ("A" , "a2@mail.com" , "a3@mail.com" ), List .of ("A" , "a3@mail.com" , "a4@mail.com" , "a4@mail.com" ));
5844
5945 List <List <String >> merged = AccountMerge .mergeAccounts (accounts );
6046
61- List <List <String >> expected = List .of (
62- List .of ("A" , "a1@mail.com" , "a2@mail.com" , "a3@mail.com" , "a4@mail.com" ));
47+ List <List <String >> expected = List .of (List .of ("A" , "a1@mail.com" , "a2@mail.com" , "a3@mail.com" , "a4@mail.com" ));
6348
6449 assertEquals (expected , merged );
6550 }
6651
6752 @ Test
6853 void testAccountsWithNoEmailsArePreserved () {
69- List <List <String >> accounts = List .of (
70- List .of ("Alex" ),
71- List .of ("Alex" , "alex1@mail.com" ),
72- List .of ("Bob" ));
54+ List <List <String >> accounts = List .of (List .of ("Alex" ), List .of ("Alex" , "alex1@mail.com" ), List .of ("Bob" ));
7355
7456 List <List <String >> merged = AccountMerge .mergeAccounts (accounts );
75- List <List <String >> expected = List .of (
76- List .of ("Alex" ),
77- List .of ("Alex" , "alex1@mail.com" ),
78- List .of ("Bob" ));
57+ List <List <String >> expected = List .of (List .of ("Alex" ), List .of ("Alex" , "alex1@mail.com" ), List .of ("Bob" ));
7958
8059 assertEquals (expected , merged );
8160 }
0 commit comments