AskBuilder extends AbstractQueryBuilder<AskBuilder> implements DatasetClause<AskBuilder>, WhereClause<AskBuilder>, SolutionModifierClause<AskBuilder> { @Override public AskBuilder clone() { AskBuilder qb = new AskBuilder(); qb.handlerBlock.addAll(handlerBlock); return qb; } AskBuilder(); @Override HandlerBlock getHandlerBlock(); @Override DatasetHandler getDatasetHandler(); @Override AskBuilder clone(); @Override AskBuilder fromNamed(String graphName); @Override AskBuilder fromNamed(Collection<String> graphNames); @Override AskBuilder from(String graphName); @Override AskBuilder from(Collection<String> graphName); @Override AskBuilder addWhere(TriplePath t); @Override AskBuilder addWhere(Triple t); @Override AskBuilder addWhere(FrontsTriple t); @Override AskBuilder addWhere(Object s, Object p, Object o); @Override AskBuilder addWhereValueVar(Object var); @Override AskBuilder addWhereValueVar(Object var, Object... values); @Override AskBuilder addWhereValueVars(Map<?,K> dataTable); @Override AskBuilder addWhereValueRow(Object... values); @Override AskBuilder addWhereValueRow(Collection<?> values); @Override List<Var> getWhereValuesVars(); @Override Map<Var, List<Node>> getWhereValuesMap(); @Override AskBuilder clearWhereValues(); @Override AskBuilder addOptional(TriplePath t); @Override AskBuilder addOptional(Triple t); @Override AskBuilder addOptional(AbstractQueryBuilder<?> t); @Override AskBuilder addOptional(FrontsTriple t); @Override AskBuilder addOptional(Object s, Object p, Object o); @Override AskBuilder addFilter(Expr expr); @Override AskBuilder addFilter(String s); @Override AskBuilder addSubQuery(AbstractQueryBuilder<?> subQuery); @Override AskBuilder addUnion(AbstractQueryBuilder<?> subQuery); @Override AskBuilder addGraph(Object graph, AbstractQueryBuilder<?> subQuery); @Override AskBuilder addGraph(Object graph, FrontsTriple triple); @Override AskBuilder addGraph(Object graph, Object subject, Object predicate, Object object); @Override AskBuilder addGraph(Object graph, Triple triple); @Override AskBuilder addGraph(Object graph, TriplePath triplePath); @Override AskBuilder addBind(Expr expression, Object var); @Override AskBuilder addBind(String expression, Object var); @Override AskBuilder addOrderBy(Expr orderBy); @Override AskBuilder addOrderBy(Object orderBy); @Override AskBuilder addOrderBy(SortCondition orderBy); @Override AskBuilder addOrderBy(Expr orderBy, Order order); @Override AskBuilder addOrderBy(Object orderBy, Order order); @Override AskBuilder addGroupBy(Object groupBy); @Override AskBuilder addGroupBy(Expr groupBy); @Override AskBuilder addGroupBy(Object var, Expr expr); @Override AskBuilder addGroupBy(Object var, String expr); @Override AskBuilder addHaving(String having); @Override AskBuilder addHaving(Expr expression); @Override AskBuilder addHaving(Object var); @Override AskBuilder setLimit(int limit); @Override AskBuilder setOffset(int offset); @Override SolutionModifierHandler getSolutionModifierHandler(); @Override Node list(Object... objs); @Override AskBuilder addMinus( AbstractQueryBuilder<?> t );  }
@Test public void testClone() { builder .addWhere( "?two", "<foo>", "<bar>"); AskBuilder builder2 = builder.clone(); builder2.addOrderBy( "?two"); String q1 = builder.buildString(); String q2 = builder2.buildString(); assertTrue( q2.contains("ORDER BY")); assertFalse( q1.contains("ORDER BY")); }