### Question:
DialectSupport { public static String convert(Template template) { StringBuilder builder = new StringBuilder(); for (Template.Element element : template.getElements()) { if (element instanceof Template.AsString) { builder.append("?").append(((Template.AsString) element).getIndex() + 1); } else if (element instanceof Template.ByIndex) { builder.append("?").append(((Template.ByIndex) element).getIndex() + 1); } else if (element instanceof Template.Transformed) { builder.append("?").append(((Template.Transformed) element).getIndex() + 1); } else if (element instanceof Template.StaticText) { builder.append(((Template.StaticText) element).getText()); } else { throw new IllegalStateException("Unsupported element " + element); } } return builder.toString(); } private  DialectSupport(); static Map<String, SQLFunction> createFunctions(SQLTemplates templates); static SQLFunction createFunction(SQLTemplates templates, Operator operator); static String convert(Template template);  }### Answer:
@Test public void convert() { Template trim = HSQLDBTemplates.DEFAULT.getTemplate(Ops.TRIM); assertEquals("trim(both from ?1)", DialectSupport.convert(trim)); Template concat = HSQLDBTemplates.DEFAULT.getTemplate(Ops.CONCAT); assertEquals("?1 || ?2", DialectSupport.convert(concat)); }