You have to complete this code:
ArrayList<ArrayList<DriverLogDatePair>> driverLogList = new ArrayList<>();
Collections.sort( driverLogList, new Comparator<ArrayList<DriverLogDatePair>>(){
@Override public int compare(
ArrayList<DriverLogDatePair> left,
ArrayList<DriverLogDatePair> right )
{
return 0;
}});
Because the first array contains an array which contains a Comparable.
The comparator you provide is for DriverLogDatePair not for ArrayList< DriverLogDatePair >
(... After comments of this post... )
At your request, to complete the comparator I suggest:
int size = left.size();
int diff = size - right.size();
if( diff != 0 ) return diff;
for( int i = 0; i < size; ++i ) {
diff = left.get( i ).compareTo( right.get(i) );
if( diff != 0 ) return diff;
}
But I have no idea of the true meaning of this comparison.
It's a semantic problem, is this really what you want?