<commit_before>package objective.taskboard.extension;

import java.util.Collections;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ApplicationToolbarService {
    
    private final List<ApplicationToolbarItem> items;
    
    @Autowired
    public ApplicationToolbarService(Optional<List<ApplicationToolbarItem>> items) {
        this.items = Collections.unmodifiableList(items.orElse(Collections.emptyList()));
    }
    
    public List<ApplicationToolbarItem> getItems() {
        return items.stream().filter(e -> e.isVisible()).collect(Collectors.toList());
    }
}<commit_msg>[TOOLS-2395] Toolbar buttons with intermittent order<commit_after>package objective.taskboard.extension;

import static java.util.Collections.emptyList;
import static java.util.Collections.unmodifiableList;
import static java.util.Comparator.comparing;
import static java.util.stream.Collectors.toList;

import java.util.List;
import java.util.Optional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ApplicationToolbarService {

    private final List<ApplicationToolbarItem> items;

    @Autowired
    public ApplicationToolbarService(Optional<List<ApplicationToolbarItem>> items) {
        this.items = unmodifiableList(items.orElse(emptyList()));
    }

    public List<ApplicationToolbarItem> getItems() {
        return items.stream()
                .filter(e -> e.isVisible())
                .sorted(comparing(ApplicationToolbarItem::getButtonId))
                .collect(toList());
    }
}
{'fraction_non_alphanumeric': 0.10154905335628227, 'fraction_numerical': 0.002294893861158921, 'mean_word_length': 4.518987341772152, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4112368', 'n_tokens_mistral': 466, 'n_tokens_neox': 470, 'n_words': 84}