QueryResults extends Iterations { public static List<Value> getAllValues(TupleQueryResult result, String var) throws QueryEvaluationException { try (Stream<BindingSet> stream = result.stream()) { return result.getBindingNames().contains(var) ? stream.map(bs -> bs.getValue(var)).collect(Collectors.toList()) : Collections.emptyList(); } }  static Model asModel(CloseableIteration<? extends Statement, ? extends RDF4JException> iteration); static Model asModel(CloseableIteration<? extends Statement, ? extends RDF4JException> iteration,
			ModelFactory modelFactory); static List<Value> getAllValues(TupleQueryResult result, String var); static Statement singleResult(GraphQueryResult result); static BindingSet singleResult(TupleQueryResult result); static GraphQueryResult distinctResults(GraphQueryResult queryResult); static TupleQueryResult distinctResults(TupleQueryResult queryResult); static TupleQueryResult limitResults(TupleQueryResult queryResult, long limit, long offset); static GraphQueryResult limitResults(GraphQueryResult queryResult, long limit, long offset); static GraphQueryResult parseGraphBackground(InputStream in, String baseURI, RDFFormat format); static GraphQueryResult parseGraphBackground(InputStream in, String baseURI, RDFParser parser); static void report(TupleQueryResult tqr, QueryResultHandler handler); static void report(GraphQueryResult gqr, RDFHandler rdfHandler); static boolean equals(TupleQueryResult tqr1, TupleQueryResult tqr2); static boolean isSubset(TupleQueryResult tqr1, TupleQueryResult tqr2); static boolean equals(GraphQueryResult result1, GraphQueryResult result2); static boolean bindingSetsCompatible(BindingSet bs1, BindingSet bs2);  }
@Test public void testStreamTupleAllValuesOfResult2() { BindingSet a = new ListBindingSet(twoBindingNames, foo, lit1); BindingSet b = new ListBindingSet(twoBindingNames, bar, lit2); tqr1.append(a); tqr1.append(b); tqr1.append(a); tqr1.append(b); tqr1.append(b); List<Value> list = QueryResults.getAllValues(tqr1, "c"); assertNotNull(list); assertTrue(list.isEmpty()); }