private static Collection getTags()

in aws-lightsail-bucket/src/main/java/software/amazon/lightsail/bucket/helpers/resource/Tags.java [59:68]


    private static Collection<Tag> getTags(Set<software.amazon.lightsail.bucket.Tag> currentTags,
            Set<software.amazon.lightsail.bucket.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());
    }