ソースを参照

payments compared every which way

NedRedmond 7 年 前
コミット
fc25bdea7b

+ 8
- 0
pom.xml ファイルの表示

@@ -7,6 +7,14 @@
7 7
     <groupId>com.zipcoder</groupId>
8 8
     <artifactId>payment</artifactId>
9 9
     <version>1.0-SNAPSHOT</version>
10
+    <dependencies>
11
+        <dependency>
12
+            <groupId>junit</groupId>
13
+            <artifactId>junit</artifactId>
14
+            <version>4.12</version>
15
+            <scope>test</scope>
16
+        </dependency>
17
+    </dependencies>
10 18
     <properties>
11 19
         <maven.compiler.source>1.8</maven.compiler.source>
12 20
         <maven.compiler.target>1.8</maven.compiler.target>

+ 62
- 0
src/main/java/com/zipcoder/payment/Check.java ファイルの表示

@@ -0,0 +1,62 @@
1
+package com.zipcoder.payment;
2
+
3
+public class Check implements Payment {
4
+    private long id;
5
+    private String payerName;
6
+    private String routingNumber;
7
+    private String accountNumber;
8
+
9
+    public Check(long id, String payerName, String routingNumber, String accountNumber) {
10
+        this.id = id;
11
+        this.payerName = payerName;
12
+        this.routingNumber = routingNumber;
13
+        this.accountNumber = accountNumber;
14
+    }
15
+
16
+    public Check() {
17
+    }
18
+
19
+    public void setId(long id) {
20
+        this.id = id;
21
+    }
22
+
23
+    public void setPayerName(String payerName) {
24
+        this.payerName = payerName;
25
+    }
26
+
27
+    public String getRoutingNumber() {
28
+        return routingNumber;
29
+    }
30
+
31
+    public void setRoutingNumber(String routingNumber) {
32
+        this.routingNumber = routingNumber;
33
+    }
34
+
35
+    public String getAccountNumber() {
36
+        return accountNumber;
37
+    }
38
+
39
+    public void setAccountNumber(String accountNumber) {
40
+        this.accountNumber = accountNumber;
41
+    }
42
+
43
+    @Override
44
+    public long getId() {
45
+        return id;
46
+    }
47
+
48
+    @Override
49
+    public String getPayerName() {
50
+        return payerName;
51
+    }
52
+
53
+    @Override
54
+    public String getShortDescription() {
55
+        return String.format("Check %s ***%s", payerName, accountNumber.substring(accountNumber.length()-4));
56
+    }
57
+
58
+    @Override
59
+    public int compareTo(Payment o) {
60
+        return this.getShortDescription().compareTo(o.getShortDescription());
61
+    }
62
+}

+ 73
- 0
src/main/java/com/zipcoder/payment/CreditCard.java ファイルの表示

@@ -0,0 +1,73 @@
1
+package com.zipcoder.payment;
2
+
3
+public class CreditCard implements Payment {
4
+
5
+    private long id;
6
+    private String payerName;
7
+    private String number;
8
+    private int expiredMonth;
9
+    private int expiredYear;
10
+
11
+    public CreditCard() {
12
+    }
13
+
14
+    public CreditCard(long id, String payerName, String number, int expiredMonth, int expiredYear) {
15
+        this.id = id;
16
+        this.payerName = payerName;
17
+        this.number = number;
18
+        this.expiredMonth = expiredMonth;
19
+        this.expiredYear = expiredYear;
20
+    }
21
+
22
+    public void setPayerName(String payerName) {
23
+        this.payerName = payerName;
24
+    }
25
+
26
+    public String getNumber() {
27
+        return number;
28
+    }
29
+
30
+    public void setNumber(String number) {
31
+        this.number = number;
32
+    }
33
+
34
+    public int getExpiredMonth() {
35
+        return expiredMonth;
36
+    }
37
+
38
+    public void setExpiredMonth(int expiredMonth) {
39
+        this.expiredMonth = expiredMonth;
40
+    }
41
+
42
+    public int getExpiredYear() {
43
+        return expiredYear;
44
+    }
45
+
46
+    public void setExpiredYear(int expiredYear) {
47
+        this.expiredYear = expiredYear;
48
+    }
49
+
50
+    public void setId(long id) {
51
+        this.id = id;
52
+    }
53
+
54
+    @Override
55
+    public long getId() {
56
+        return this.id;
57
+    }
58
+
59
+    @Override
60
+    public String getPayerName() {
61
+        return this.payerName;
62
+    }
63
+
64
+    @Override
65
+    public String getShortDescription() {
66
+        return String.format("CC %s %s %d/%d", payerName, number.substring(number.length()-4), expiredMonth, expiredYear);
67
+    }
68
+
69
+    @Override
70
+    public int compareTo(Payment o) {
71
+        return this.getShortDescription().compareTo(o.getShortDescription());
72
+    }
73
+}

+ 52
- 0
src/main/java/com/zipcoder/payment/PayPal.java ファイルの表示

@@ -0,0 +1,52 @@
1
+package com.zipcoder.payment;
2
+
3
+public class PayPal implements Payment {
4
+    private long id;
5
+    private String payerName;
6
+    private String email;
7
+
8
+    public PayPal(long id, String payerName, String email) {
9
+        this.id = id;
10
+        this.payerName = payerName;
11
+        this.email = email;
12
+    }
13
+
14
+    public PayPal() {
15
+    }
16
+
17
+    public void setId(long id) {
18
+        this.id = id;
19
+    }
20
+
21
+    public void setPayerName(String payerName) {
22
+        this.payerName = payerName;
23
+    }
24
+
25
+    public String getEmail() {
26
+        return email;
27
+    }
28
+
29
+    public void setEmail(String email) {
30
+        this.email = email;
31
+    }
32
+
33
+    @Override
34
+    public long getId() {
35
+        return id;
36
+    }
37
+
38
+    @Override
39
+    public String getPayerName() {
40
+        return payerName;
41
+    }
42
+
43
+    @Override
44
+    public String getShortDescription() {
45
+        return String.format("Paypal %s %s", payerName,email);
46
+    }
47
+
48
+    @Override
49
+    public int compareTo(Payment o) {
50
+        return this.getShortDescription().compareTo(o.getShortDescription());
51
+    }
52
+}

+ 11
- 0
src/main/java/com/zipcoder/payment/Payment.java ファイルの表示

@@ -0,0 +1,11 @@
1
+package com.zipcoder.payment;
2
+
3
+public interface Payment extends Comparable<Payment> {
4
+
5
+    long getId();
6
+
7
+    String getPayerName();
8
+
9
+    String getShortDescription();
10
+
11
+}

+ 25
- 0
src/main/java/com/zipcoder/payment/PaymentPresenter.java ファイルの表示

@@ -1,6 +1,31 @@
1 1
 package com.zipcoder.payment;
2 2
 
3 3
 public class PaymentPresenter {
4
+    PaymentSortByPayer paymentSortByPayer = new PaymentSortByPayer();
5
+    private String paymentPresentation = "";
4 6
 
7
+    public String toString(Payment ... payments){
8
+        paymentSortByPayer.compareArray(payments);
9
+        for (Payment payment : payments) {
10
+            paymentPresentation += payment.getShortDescription() + "\n";
11
+        }
12
+        return paymentPresentation;
13
+    }
14
+
15
+    public String toStringByPayerName(Payment ... payments){
16
+        paymentSortByPayer.compareArrayByPayerName(payments);
17
+        for (Payment payment : payments) {
18
+            paymentPresentation += payment.getShortDescription() + "\n";
19
+        }
20
+        return paymentPresentation;
21
+    }
22
+
23
+    public String toStringById(Payment ... payments){
24
+        paymentSortByPayer.compareArrayById(payments);
25
+        for (Payment payment : payments) {
26
+            paymentPresentation += payment.getShortDescription() + "\n";
27
+        }
28
+        return paymentPresentation;
29
+    }
5 30
 
6 31
 }

+ 71
- 0
src/main/java/com/zipcoder/payment/PaymentSortByPayer.java ファイルの表示

@@ -0,0 +1,71 @@
1
+package com.zipcoder.payment;
2
+
3
+public class PaymentSortByPayer implements Comparable<Payment> {
4
+    Payment payment1;
5
+    Payment payment2;
6
+    Payment[] payments;
7
+
8
+    public PaymentSortByPayer() {
9
+    }
10
+
11
+    public PaymentSortByPayer(Payment payment1, Payment payment2) {
12
+        this.payment1 = payment1;
13
+        this.payment2 = payment2;
14
+    }
15
+
16
+    public PaymentSortByPayer(Payment payment1) {
17
+        this.payment1 = payment1;
18
+    }
19
+
20
+    @Override
21
+    public int compareTo(Payment o) {
22
+        return payment1.getShortDescription().compareTo(o.getShortDescription());
23
+    }
24
+
25
+    public int compare(Payment payment1, Payment payment2) {
26
+        return payment1.getShortDescription().compareTo(payment2.getShortDescription());
27
+    }
28
+
29
+    public int compare() {
30
+        return this.payment1.getShortDescription().compareTo(this.payment2.getShortDescription());
31
+    }
32
+
33
+    public Payment[] compareArray(Payment ... payments) {
34
+        for (int i = 0; i < payments.length-1; i++) {
35
+            for (int j = 0; j < payments.length-1; j++) {
36
+                if (compare(payments[j], payments[j+1]) > 0) {
37
+                    Payment temp = payments[j];
38
+                    payments[j] = payments[j+1];
39
+                    payments[j+1] = temp;
40
+                }
41
+            }
42
+        }
43
+        return payments;
44
+    }
45
+
46
+    public Payment[] compareArrayById(Payment ... payments) {
47
+        for (int i = 0; i < payments.length-1; i++) {
48
+            for (int j = 0; j < payments.length-1; j++) {
49
+                if (payments[j].getId() > payments[j+1].getId()) {
50
+                    Payment temp = payments[j];
51
+                    payments[j] = payments[j+1];
52
+                    payments[j+1] = temp;
53
+                }
54
+            }
55
+        }
56
+        return payments;
57
+    }
58
+
59
+    public Payment[] compareArrayByPayerName(Payment ... payments) {
60
+        for (int i = 0; i < payments.length-1; i++) {
61
+            for (int j = 0; j < payments.length-1; j++) {
62
+                if (payments[j].getPayerName().compareTo(payments[j+1].getPayerName()) > 0) {
63
+                    Payment temp = payments[j];
64
+                    payments[j] = payments[j+1];
65
+                    payments[j+1] = temp;
66
+                }
67
+            }
68
+        }
69
+        return payments;
70
+    }
71
+}

+ 107
- 0
src/test/java/com/zipcoder/payment/CheckTest.java ファイルの表示

@@ -0,0 +1,107 @@
1
+package com.zipcoder.payment;
2
+
3
+import org.junit.Assert;
4
+import org.junit.Test;
5
+
6
+public class CheckTest {
7
+    Check check =  new Check();
8
+    long testId = 9999999;
9
+    String testPayerName = "Test Testmond";
10
+    String testRoutingNumber = "11432543";
11
+    String testAccountNumber = "134344551";
12
+
13
+    @Test
14
+    public void setId0() {
15
+        Assert.assertEquals(0, check.getId());
16
+    }
17
+
18
+    @Test
19
+    public void setId() {
20
+        check.setId(testId);
21
+        Assert.assertEquals(testId, check.getId());
22
+    }
23
+
24
+    @Test
25
+    public void getId() {
26
+        check.setId(testId);
27
+
28
+        long expected = testId;
29
+        long actual = check.getId();
30
+
31
+        Assert.assertEquals(expected, actual);
32
+    }
33
+
34
+    @Test
35
+    public void setPayerName0() {
36
+        Assert.assertNull(check.getPayerName());
37
+    }
38
+
39
+    @Test
40
+    public void setPayerName() {
41
+        check.setPayerName(testPayerName);
42
+        Assert.assertNotNull(check.getPayerName());
43
+    }
44
+
45
+    @Test
46
+    public void getRoutingNumber() {
47
+        check.setRoutingNumber(testRoutingNumber);
48
+
49
+        String expected = testRoutingNumber;
50
+        String actual = check.getRoutingNumber();
51
+
52
+        Assert.assertEquals(expected,actual);
53
+    }
54
+
55
+    @Test
56
+    public void setRoutingNumber0() {
57
+        Assert.assertNull(check.getRoutingNumber());
58
+    }
59
+
60
+    @Test
61
+    public void setRoutingNumber() {
62
+        check.setRoutingNumber(testRoutingNumber);
63
+        Assert.assertNotNull(check.getRoutingNumber());
64
+    }
65
+
66
+    @Test
67
+    public void getAccountNumber() {
68
+        check.setAccountNumber(testAccountNumber);
69
+
70
+        String expected = testAccountNumber;
71
+        String actual = check.getAccountNumber();
72
+
73
+        Assert.assertEquals(expected,actual);
74
+    }
75
+
76
+    @Test
77
+    public void setAccountNumber0() {
78
+        Assert.assertNull(check.getRoutingNumber());
79
+    }
80
+
81
+    @Test
82
+    public void setAccountNumber() {
83
+        check.setAccountNumber(testAccountNumber);
84
+        Assert.assertNotNull(check.getAccountNumber());
85
+    }
86
+
87
+    @Test
88
+    public void getPayerName() {
89
+        check.setPayerName(testPayerName);
90
+
91
+        String expected = testPayerName;
92
+        String actual = check.getPayerName();
93
+
94
+        Assert.assertEquals(expected,actual);
95
+    }
96
+
97
+    @Test
98
+    public void getShortDescription() {
99
+        check.setPayerName(testPayerName);
100
+        check.setAccountNumber(testAccountNumber);
101
+
102
+        String expected = "Check Test Testmond ****4551";
103
+        String actual = check.getShortDescription();
104
+
105
+        Assert.assertEquals(expected,actual);
106
+    }
107
+}

+ 35
- 0
src/test/java/com/zipcoder/payment/ComparableTest.java ファイルの表示

@@ -0,0 +1,35 @@
1
+package com.zipcoder.payment;
2
+
3
+import org.junit.Assert;
4
+import org.junit.Test;
5
+
6
+public class ComparableTest {
7
+
8
+    @Test
9
+    public void compareToTest() {
10
+        PayPal payPal = new PayPal(0, "Tia Mowry", "tia@mowry.com");
11
+        Check check = new Check(0, "Tia Mowry", "11432543", "134344551");
12
+
13
+        Assert.assertTrue(payPal.compareTo(check) > 0);
14
+    }
15
+
16
+    @Test
17
+    public void compareToTest1() {
18
+        PaymentSortByPayer payment1 = new PaymentSortByPayer(new PayPal(0, "Tia Mowry", "tia@mowry.com"));
19
+        Check payment2 = new Check(0, "Tia Mowry", "11432543", "134344551");
20
+
21
+        Assert.assertTrue(payment1.compareTo(payment2) > 0);
22
+    }
23
+
24
+    @Test
25
+    public void compareToTest2() {
26
+        PaymentSortByPayer payments = new PaymentSortByPayer(
27
+                new PayPal(0, "Tia Mowry", "tia@mowry.com"),
28
+                new Check(0, "Tia Mowry", "11432543", "134344551")
29
+        );
30
+
31
+        int paymentComparison = payments.compare();
32
+
33
+        Assert.assertTrue(paymentComparison > 0);
34
+    }
35
+}

+ 137
- 0
src/test/java/com/zipcoder/payment/CreditCardTest.java ファイルの表示

@@ -0,0 +1,137 @@
1
+package com.zipcoder.payment;
2
+
3
+import org.junit.Assert;
4
+import org.junit.Test;
5
+
6
+public class CreditCardTest {
7
+
8
+    CreditCard creditCard = new CreditCard();
9
+    long testId = 9999999;
10
+    String testName = "Test Testmond";
11
+    String testNumber = "3026666666";
12
+    int testExpiredMonth = 10;
13
+    int testExpiredYear = 1999;
14
+
15
+
16
+    @Test
17
+    public void setId0() {
18
+        Assert.assertEquals( 0, creditCard.getId());
19
+    }
20
+
21
+    @Test
22
+    public void setId1() {
23
+        creditCard.setId(testId);
24
+
25
+        Assert.assertNotNull(creditCard.getId());
26
+    }
27
+
28
+    @Test
29
+    public void getId() {
30
+        creditCard.setId(testId);
31
+
32
+        long actual = creditCard.getId();
33
+        long expected = testId;
34
+
35
+        Assert.assertEquals(expected,actual);
36
+    }
37
+
38
+    @Test
39
+    public void setPayerName0() {
40
+        Assert.assertNull(creditCard.getPayerName());
41
+    }
42
+
43
+    @Test
44
+    public void setPayerName() {
45
+        creditCard.setPayerName(testName);
46
+        Assert.assertNotNull(creditCard.getPayerName());
47
+    }
48
+
49
+    @Test
50
+    public void getPayerName() {
51
+        creditCard.setPayerName(testName);
52
+
53
+        String expected = testName;
54
+        String actual = creditCard.getPayerName();
55
+
56
+        Assert.assertEquals(expected, actual);
57
+    }
58
+
59
+    @Test
60
+    public void getNumber() {
61
+        creditCard.setNumber(testNumber);
62
+
63
+        String expected = testNumber;
64
+        String actual = creditCard.getNumber();
65
+
66
+        Assert.assertEquals(expected,actual);
67
+    }
68
+
69
+    @Test
70
+    public void setNumber() {
71
+        creditCard.setNumber(testNumber);
72
+
73
+        Assert.assertNotNull(creditCard.getNumber());
74
+    }
75
+
76
+    @Test
77
+    public void setNumber0() {
78
+        Assert.assertNull(creditCard.getNumber());
79
+    }
80
+
81
+    @Test
82
+    public void getExpiredMonth() {
83
+        creditCard.setExpiredMonth(testExpiredMonth);
84
+
85
+        int expected = testExpiredMonth;
86
+        int actual = creditCard.getExpiredMonth();
87
+
88
+        Assert.assertEquals(expected,actual);
89
+    }
90
+
91
+    @Test
92
+    public void setExpiredMonth0() {
93
+        Assert.assertEquals(0,creditCard.getExpiredMonth());
94
+    }
95
+
96
+    @Test
97
+    public void setExpiredMonth() {
98
+        creditCard.setExpiredMonth(testExpiredMonth);
99
+
100
+        Assert.assertEquals(testExpiredMonth,creditCard.getExpiredMonth());
101
+    }
102
+
103
+    @Test
104
+    public void getExpiredYear() {
105
+        creditCard.setExpiredYear(testExpiredYear);
106
+
107
+        int expected = testExpiredYear;
108
+        int actual = creditCard.getExpiredYear();
109
+
110
+        Assert.assertEquals(expected,actual);
111
+    }
112
+
113
+    @Test
114
+    public void setExpiredYear0() {
115
+        Assert.assertEquals(0, creditCard.getExpiredYear());
116
+    }
117
+
118
+    @Test
119
+    public void setExpiredYear() {
120
+        creditCard.setExpiredYear(testExpiredYear);
121
+        Assert.assertEquals(testExpiredYear,creditCard.getExpiredYear());
122
+    }
123
+
124
+    @Test
125
+    public void getShortDescription() {
126
+        creditCard.setId(testId);
127
+        creditCard.setPayerName(testName);
128
+        creditCard.setNumber(testNumber);
129
+        creditCard.setExpiredMonth(testExpiredMonth);
130
+        creditCard.setExpiredYear(testExpiredYear);
131
+
132
+        String expected = "CC Test Testmond 6666 10/1999";
133
+        String actual = creditCard.getShortDescription();
134
+
135
+        Assert.assertEquals(expected,actual);
136
+    }
137
+}

+ 87
- 0
src/test/java/com/zipcoder/payment/PayPalTest.java ファイルの表示

@@ -0,0 +1,87 @@
1
+package com.zipcoder.payment;
2
+
3
+import org.junit.Assert;
4
+import org.junit.Test;
5
+
6
+public class PayPalTest {
7
+    PayPal payPal = new PayPal();
8
+    long testId = 9999999;
9
+    String testPayerName = "Test Testmond";
10
+    String testEmail = "test@test.test";
11
+
12
+    @Test
13
+    public void setId0() {
14
+        Assert.assertEquals(0, payPal.getId());
15
+    }
16
+
17
+    @Test
18
+    public void setId() {
19
+        payPal.setId(testId);
20
+        Assert.assertEquals(testId, payPal.getId());
21
+    }
22
+
23
+    @Test
24
+    public void getId() {
25
+        payPal.setId(testId);
26
+
27
+        long expected = testId;
28
+        long actual = payPal.getId();
29
+
30
+        Assert.assertEquals(expected, actual);
31
+    }
32
+
33
+    @Test
34
+    public void setPayerName0() {
35
+        Assert.assertNull(payPal.getPayerName());
36
+    }
37
+
38
+
39
+    @Test
40
+    public void setPayerName() {
41
+        payPal.setPayerName(testPayerName);
42
+        Assert.assertNotNull(payPal.getPayerName());
43
+    }
44
+
45
+    @Test
46
+    public void getPayerName() {
47
+        payPal.setPayerName(testPayerName);
48
+
49
+        String expected = testPayerName;
50
+        String actual = payPal.getPayerName();
51
+
52
+        Assert.assertEquals(expected,actual);
53
+    }
54
+
55
+    @Test
56
+    public void setEmail0() {
57
+        Assert.assertNull(payPal.getEmail());
58
+    }
59
+
60
+
61
+    @Test
62
+    public void setEmail() {
63
+        payPal.setEmail(testEmail);
64
+        Assert.assertNotNull(payPal.getEmail());
65
+    }
66
+
67
+    @Test
68
+    public void getEmail() {
69
+        payPal.setEmail(testEmail);
70
+
71
+        String expected = testEmail;
72
+        String actual = payPal.getEmail();
73
+
74
+        Assert.assertEquals(expected,actual);
75
+    }
76
+
77
+    @Test
78
+    public void getShortDescription() {
79
+        payPal.setPayerName(testPayerName);
80
+        payPal.setEmail(testEmail);
81
+
82
+        String expected = "Paypal Test Testmond test@test.test";
83
+        String actual = payPal.getShortDescription();
84
+
85
+        Assert.assertEquals(expected,actual);
86
+    }
87
+}

+ 64
- 0
src/test/java/com/zipcoder/payment/PaymentPresenterTest.java ファイルの表示

@@ -1,4 +1,68 @@
1 1
 package com.zipcoder.payment;
2 2
 
3
+import org.junit.Assert;
4
+import org.junit.Test;
5
+
3 6
 public class PaymentPresenterTest {
7
+
8
+    @Test
9
+    public void toStringNoPayment() {
10
+        Payment[] payments = new Payment[0];
11
+        PaymentPresenter presenter = new PaymentPresenter();
12
+        String expected = "";
13
+
14
+        String actual = presenter.toString(payments);
15
+
16
+        Assert.assertEquals(expected, actual);
17
+    }
18
+
19
+    @Test
20
+    public void toStringMultiplePayments () {
21
+        Payment[] payments = new Payment[2];
22
+        Payment paypal = new PayPal(4L, "Tia Mowry", "tia@mowry.com");
23
+        Payment check = new Check(81L, "Tia Mowry", "11432543", "134344551");
24
+
25
+        payments[0] = paypal;
26
+        payments[1] = check;
27
+
28
+        PaymentPresenter presenter = new PaymentPresenter();
29
+        String expected = "Check Tia Mowry ***4551\nPaypal Tia Mowry tia@mowry.com\n";
30
+
31
+        String actual = presenter.toString(payments);
32
+
33
+        Assert.assertEquals(expected, actual);
34
+    }
35
+
36
+    @Test
37
+    public void toStringByPayerName() {
38
+        Payment[] payments = new Payment[2];
39
+        Payment paypal = new PayPal(4L, "Tamara Mowry", "tamara@mowry.com");
40
+        Payment check = new Check(81L, "Tia Mowry", "11432543", "134344551");
41
+
42
+        payments[0] = paypal;
43
+        payments[1] = check;
44
+
45
+        PaymentPresenter presenter = new PaymentPresenter();
46
+        String expected = "Paypal Tamara Mowry tamara@mowry.com\nCheck Tia Mowry ***4551\n";
47
+
48
+        String actual = presenter.toStringByPayerName(payments);
49
+        Assert.assertEquals(expected, actual);
50
+    }
51
+
52
+    @Test
53
+    public void toStringById() {
54
+        Payment[] payments = new Payment[2];
55
+        Payment paypal = new PayPal(120L, "Tamara Mowry", "tamara@mowry.com");
56
+        Payment check = new Check(81L, "Tia Mowry", "11432543", "134344551");
57
+
58
+        payments[0] = paypal;
59
+        payments[1] = check;
60
+
61
+        PaymentPresenter presenter = new PaymentPresenter();
62
+        String expected = "Check Tia Mowry ***4551\nPaypal Tamara Mowry tamara@mowry.com\n";
63
+
64
+        String actual = presenter.toStringById(payments);
65
+        Assert.assertEquals(expected, actual);
66
+    }
67
+
4 68
 }