|
|
|
|
|
|
1
|
package com.zipcoder.payment;
|
1
|
package com.zipcoder.payment;
|
|
2
|
|
2
|
|
|
3
|
import java.util.Arrays;
|
3
|
import java.util.Arrays;
|
|
|
|
4
|
+import java.util.Comparator;
|
|
4
|
|
5
|
|
|
5
|
public class PaymentPresenter {
|
6
|
public class PaymentPresenter {
|
|
6
|
|
7
|
|
|
7
|
public String toString(Payment[] payments) {
|
8
|
public String toString(Payment[] payments) {
|
|
|
|
9
|
+ //Comparator<Payment> shortDescComp = (p1, p2) -> p1.getShortDescription().compareTo(p2.getShortDescription());
|
|
8
|
Arrays.sort(payments, new PaymentSortByShortDescription());
|
10
|
Arrays.sort(payments, new PaymentSortByShortDescription());
|
|
9
|
return createArrayString(payments);
|
11
|
return createArrayString(payments);
|
|
10
|
}
|
12
|
}
|