// TODO: smarter initialization of the map
private Map<String, T> getChoiceMap() {
        if (choiceMap == null || alwaysReload()) {
            Collection<T> choices = loadChoices();
            choiceMap = new HashMap<>();
            for (T choice: choices) {
                // TODO: smarter initialization of the map
                choiceMap.put(choice.getLocalPart(), choice);
            }
        }
        return choiceMap;
    }
choiceMap = new HashMap<>();
for (T choice: choices) {
// TODO: smarter initialization of the map
choiceMap.put(choice.getLocalPart(), choice);
}
private Map<String, T> getChoiceMap() {
if (choiceMap == null || alwaysReload()) {
Collection<T> choices = loadChoices();
choiceMap = new HashMap<>();
for (T choice: choices) {
// TODO: smarter initialization of the map
choiceMap.put(choice.getLocalPart(), choice);
}
}
return choiceMap;
}
private Map<String, T> getChoiceMap() {
if (choiceMap == null || alwaysReload()) {
Collection<T> choices = loadChoices();
choiceMap = new HashMap<>();
for (T choice: choices) {
// TODO: smarter initialization of the map
choiceMap.put(choice.getLocalPart(), choice);
}
}
return choiceMap;
}