DatasetHandler implements Handler { public void fromNamed(String graphName) { query.addNamedGraphURI(graphName); } DatasetHandler(Query query); void addAll(DatasetHandler datasetHandler); void fromNamed(String graphName); void fromNamed(Collection<String> graphNames); void from(String graphName); void from(Collection<String> graphNames); @Override void setVars(Map<Var, Node> values); @Override void build();  }
@Test public void testFromNamedString() { handler.fromNamed("foo"); assertTrue(query.toString().contains("FROM NAMED <foo>")); }
@Test public void fromNamedCollection() { String[] names = { "foo", "bar" }; handler.fromNamed(Arrays.asList(names)); String s = query.toString(); assertTrue(s.contains("FROM NAMED <foo>")); assertTrue(s.contains("FROM NAMED <bar>")); }