in aws-lightsail-loadbalancer/src/main/java/software/amazon/lightsail/loadbalancer/helpers/resource/Tags.java [59:68]
private static Collection<Tag> getTags(Set<software.amazon.lightsail.loadbalancer.Tag> currentTags,
Set<software.amazon.lightsail.loadbalancer.Tag> desiredTags) {
return currentTags.stream()
.filter(tag -> tag.getKey() != null && desiredTags.stream()
.noneMatch(curTag -> curTag.getKey() != null && tag.getKey().equals(curTag.getKey())
&& ((tag.getValue() == null && curTag.getValue() == null)
|| (tag.getValue() != null && tag.getValue().equals(curTag.getValue()))
|| (curTag.getValue() != null && curTag.getValue().equals(tag.getValue())))))
.map(tag -> Tag.builder().key(tag.getKey()).value(tag.getValue()).build()).collect(Collectors.toList());
}