旧代码:
Collection<String> certificateIds = new ArrayList<>();
paymentRequest.getAssignments().stream()
.filter()
.foreach(add(list))......
用map().collect()来替换:
Collection<String> certificateIds = paymentRequest.getAssignments().stream()
.map(PaymentAssignmentItem::getTargetEntityLink)
.filter(entityLink -> entityLink.getURIString().contains(BillingProduct.NAME))
.map(entityLink -> EntityLinkUtil.getRootId(entityLink).toString()).collect(Collectors.toList());