### Question:
SQLTemplate extends AbstractQuery implements ParameterizedQuery { public String getDefaultTemplate() { return defaultTemplate; } SQLTemplate();  SQLTemplate(String defaultTemplate, boolean isFetchingDataRows);  SQLTemplate(DataMap rootMap, String defaultTemplate, boolean isFetchingDataRows);  SQLTemplate(ObjEntity rootEntity, String defaultTemplate);  SQLTemplate(Class<?> rootClass, String defaultTemplate);  SQLTemplate(DbEntity rootEntity, String defaultTemplate);  SQLTemplate(String objEntityName, String defaultTemplate); void setResultColumnsTypes(Class<?> ...types); @Override void setRoot(Object value); @Override void route(QueryRouter router, EntityResolver resolver, Query substitutedQuery); @Override QueryMetadata getMetaData(EntityResolver resolver); @Override SQLAction createSQLAction(SQLActionVisitor visitor); void initWithProperties(Map<String, ?> properties); @SuppressWarnings("unchecked") Iterator<Map<String, ?>> parametersIterator(); int parametersSize(); @SuppressWarnings("unchecked") void setParams(Map<String, ?> params); void setParamsArray(Object... params); void setParamsList(List<Object> params); SQLTemplate queryWithParameters(Map<String, ?>... parameters); @Override Query createQuery(Map<String, ?> parameters); int getFetchLimit(); void setFetchLimit(int fetchLimit); int getFetchOffset(); void setFetchOffset(int fetchOffset); int getPageSize(); void setPageSize(int pageSize); void setFetchingDataRows(boolean flag); boolean isFetchingDataRows(); String getDefaultTemplate(); void setDefaultTemplate(String string); synchronized String getTemplate(String key); synchronized String getCustomTemplate(String key); synchronized void setTemplate(String key, String template); synchronized void removeTemplate(String key); synchronized Collection<String> getTemplateKeys(); Map<String, ?> getParams(); List<Object> getPositionalParams(); Map<String, ?> getParameters(); @SuppressWarnings("unchecked") void setParameters(Map<String, ?>... parameters); PrefetchTreeNode getPrefetchTree(); PrefetchTreeNode addPrefetch(String prefetchPath); void addPrefetch(PrefetchTreeNode prefetchElement); void removePrefetch(String prefetch); void addPrefetches(Collection<String> prefetches); void clearPrefetches(); CapsStrategy getColumnNamesCapitalization(); void setColumnNamesCapitalization(CapsStrategy columnNameCapitalization); void setResult(SQLResult resultSet); SQLResult getResult(); void setStatementFetchSize(int size); int getStatementFetchSize(); void setQueryTimeout(int queryTimeout); int getQueryTimeout(); String getDataNodeName(); void setDataNodeName(String dataNodeName); boolean isReturnGeneratedKeys(); void setReturnGeneratedKeys(boolean returnGeneratedKeys); List<Class<?>> getResultColumnsTypes(); void setResultColumnsTypes(List<Class<?>> resultColumnsTypes); void setUseScalar(boolean useScalar); boolean isUseScalar(); void setResultMapper(Function<?,?> resultMapper); static final String COLUMN_NAME_CAPITALIZATION_PROPERTY; }### Answer:
@Test public void testGetDefaultTemplate() { SQLTemplate query = new SQLTemplate(); query.setDefaultTemplate("AAA # BBB"); assertEquals("AAA # BBB", query.getDefaultTemplate()); }
@Test public void testSerializability() throws Exception { SQLTemplate o = new SQLTemplate("Test", "DO SQL"); Object clone = Util.cloneViaSerialization(o); assertTrue(clone instanceof SQLTemplate); SQLTemplate c1 = (SQLTemplate) clone; assertNotSame(o, c1); assertEquals(o.getRoot(), c1.getRoot()); assertEquals(o.getDefaultTemplate(), c1.getDefaultTemplate()); }