Collection<OptionDescription> () { TemplateSettings settings = TemplateSettings.getInstance(); if (settings == null) { return Collections.emptyList(); } Collection<OptionDescription> options = new ArrayList<>(); for (TemplateGroup group : settings.getTemplateGroups()) { for (final TemplateImpl element : group.getElements()) { options.add(new Option(element)); } } return options; }