Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class EligibilityRequest {
- private String channel; // it's part of Equals
- ...
- private Lista<String> productCodes // it's not part of Equals and need to be aggregated within instance of EligibilityRequest "equal"
- Map<EligibilityRequest, List<String>> uniqueEligibilityRequests = new HashMap<>();
- uniqueEligibilityRequests = requests.stream()
- .collect(groupingBy(request -> request,
- Collectors.mapping(request -> request.getProductsCode(), toList())
- ));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement