@NotNull
    public Set<String> getCustomTemplateNames() {
        try {
            String pref = lock().computeReading(o -> customTemplatesStore.getString(PREF_STORE_KEY));
            if (pref != null && !pref.trim().isEmpty()) {
                Reader input = new StringReader(pref);
                TemplateReaderWriter reader = new TemplateReaderWriter();
                return Stream.of(reader.read(input)).map(t -> t.getTemplate().getName()).collect(Collectors.toSet());
            } 
        } catch (IOException ex) {
            log.error("Failed to load custom template names", ex);
        } 
        return Collections.emptySet();
    }
Returns set of custom sql templates declared in custom templates store
Partially copied from eclipse sources
plugins/org.jkiss.dbeaver.ui.editors.sql/src/org/jkiss/dbeaver/ui/editors/sql/templates/SQLTemplateStore.java