SingleQuadHolder implements QuadHolder { @Override public ExtendedIterator<Quad> getQuads() { return new SingletonIterator<Quad>(updated==null?quad:updated); } SingleQuadHolder( Quad quad );  SingleQuadHolder( Triple triple );  SingleQuadHolder( Node graph, Triple triple ); @Override ExtendedIterator<Quad> getQuads(); @Override QuadHolder setValues(Map<Var, Node> values);  }
@Test public void getQuads_Quad() { Node g = NodeFactory.createURI( "g" ); Node s = NodeFactory.createURI( "s" ); Node p = NodeFactory.createURI( "p" ); Node o = NodeFactory.createURI( "o" ); Quad quad = new Quad( g, s, p, o ); holder = new SingleQuadHolder( quad ); List<Quad> lst = holder.getQuads().toList(); assertEquals( 1, lst.size() ); assertEquals( quad, lst.get(0)); }
@Test public void getQuads_Triple() { Node s = NodeFactory.createURI( "s" ); Node p = NodeFactory.createURI( "p" ); Node o = NodeFactory.createURI( "o" ); Triple triple = new Triple( s, p, o ); Quad quad = new Quad( Quad.defaultGraphNodeGenerated, s, p, o ); holder = new SingleQuadHolder( triple ); List<Quad> lst = holder.getQuads().toList(); assertEquals( 1, lst.size() ); assertEquals( quad, lst.get(0)); }