class AzureCloudResourceService {

    public List<CloudResource> getDeploymentCloudResources(Deployment templateDeployment) {
        PagedList<DeploymentOperation> operations = templateDeployment.deploymentOperations().list();
        return operations.stream()
                .filter(Predicate.not(Predicate.isEqual(null)))
                .filter(deploymentOperation -> Objects.nonNull(deploymentOperation.targetResource())
                        && StringUtils.isNotBlank(deploymentOperation.provisioningState()))
                .map(deploymentOperation ->
                        convert(deploymentOperation.targetResource(),
                                convertProvisioningState(deploymentOperation.provisioningState())))
                .filter(Objects::nonNull)
                .collect(Collectors.toList());
    }

}