class AwsIamService {

    public SortedSet<String> getStatementResources(Statement statement) {
        List<Resource> resources = statement.getResources();
        if (resources == null) {
            return new TreeSet<>();
        }
        return resources.stream()
                .map(Resource::getId)
                .collect(Collectors.toCollection(TreeSet::new));
    }

}