WhereHandler implements Handler { public Map<Var,List<Node>> getValuesMap() { return valuesHandler.getValuesMap(); } WhereHandler(Query query);  WhereHandler(); Element getQueryPattern(); Query getQuery(); void addAll(WhereHandler whereHandler); Element getElement(); ElementGroup getClause(); void addWhere(TriplePath t); void addWhere(ValuesHandler values); void addOptional(TriplePath t); void addOptional(WhereHandler whereHandler); void addFilter(String expression); void addFilter(Expr expr); void addSubQuery(AbstractQueryBuilder<?> subQuery); ElementSubQuery makeSubQuery(AbstractQueryBuilder<?> subQuery); void addUnion(AbstractQueryBuilder<?> subQuery); void addGraph(Node graph, WhereHandler subQuery); void addGraph(Node graph, TriplePath subQuery); void addBind(Expr expr, Var var); void addBind(String expression, Var var); @Override void setVars(Map<Var, Node> values); @Override void build(); Node list(Object... objs); void addMinus( AbstractQueryBuilder<?> qb ); void addValueVar(PrefixMapping prefixMapping, Object var); void addValueVar(PrefixMapping prefixMapping, Object var, Object... objects); void addValueVars(PrefixMapping prefixMapping, Map<?,K> dataTable); void addValueRow(PrefixMapping prefixMapping, Object... values); void addValueRow(PrefixMapping prefixMapping, Collection<?> values); List<Var> getValuesVars(); Map<Var,List<Node>> getValuesMap(); void clearValues();  }
@Test public void testGetValuesMap() { final Var v = Var.alloc("v"); final Var x = Var.alloc("x"); handler.addValueVar( query.getPrefixMapping(), v ); handler.addValueVar( query.getPrefixMapping(), x ); handler.addValueRow( query.getPrefixMapping(), Arrays.asList("<one>", "three")); handler.addValueRow( query.getPrefixMapping(), Arrays.asList("<two>", "four" )); Map<Var,List<Node>> map = handler.getValuesMap(); assertEquals( 2, map.keySet().size()); assertTrue( map.keySet().contains( v )); assertTrue( map.keySet().contains( x )); List<Node> lst = map.get(v); assertEquals(2, lst.size() ); assertTrue( lst.contains( NodeFactory.createURI( "one"))); assertTrue( lst.contains( NodeFactory.createURI( "two"))); lst = map.get(x); assertEquals(2, lst.size() ); assertTrue( lst.contains( NodeFactory.createLiteral( "three"))); assertTrue( lst.contains( NodeFactory.createLiteral( "four"))); }