Checkpoint: ExchangeServiceTest

Signed-off-by: Marcin Woźniak <y0rune@aol.com>
This commit is contained in:
2021-01-13 12:23:00 +01:00
parent f9a27abb32
commit ed528ad9a0
4 changed files with 207 additions and 142 deletions
buisnesslogic/src
main
java
com
plannaplan
test
java
com
plannaplan

@ -1,10 +1,13 @@
package com.plannaplan.services;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.HashSet;
import java.util.List;
import java.util.Optional;
import java.util.Set;
import java.util.TreeSet;
import java.util.stream.Collectors;
import com.plannaplan.entities.Assignment;
@ -116,9 +119,11 @@ public class ExchangeService {
final Exchange exchangeOne = (Exchange) m[0];
final Exchange exchangeTwo = (Exchange) m[1];
return new MatchData(exchangeOne, exchangeTwo);
}).collect(Collectors.toList());
final Set<MatchData> filterMatches = new HashSet<>(matches);
Set<MatchData> filterMatches = new TreeSet<>((m1, m2) -> m1.compare(m2));
filterMatches.addAll(matches);
return filterMatches;
}
}