RDFCollections { public static void extract(Model sourceModel, Resource head, Consumer<Statement> consumer, Resource... contexts) { Objects.requireNonNull(sourceModel, "source model may not be null"); GetStatementOptional statementSupplier = (s, p, o, c) -> ((Model) sourceModel).filter(s, p, o, c).stream().findAny(); extract(statementSupplier, head, consumer, Models::modelException, contexts); }  static C asRDF(Iterable<?> values, Resource head, C sink,
			Resource... contexts); static C asRDF(Iterable<?> values, Resource head, C sink,
			ValueFactory valueFactory, Resource... contexts); static C asValues(final Model m, Resource head, C collection,
			Resource... contexts); static void consumeCollection(Iterable<?> values, Resource head, Consumer<Statement> consumer,
			Resource... contexts); static void consumeCollection(Iterable<?> values, Resource head, Consumer<Statement> consumer,
			ValueFactory vf,
			Resource... contexts); static void consumeValues(final Model m, Resource head, Consumer<Value> consumer, Resource... contexts); static C getCollection(Model sourceModel, Resource head, C sink,
			Resource... contexts); static void extract(Model sourceModel, Resource head, Consumer<Statement> consumer, Resource... contexts); static void extract(GetStatementOptional statementSupplier, Resource head,
			Consumer<Statement> collectionConsumer, Function<String, Supplier<E>> exceptionSupplier,
			Resource... contexts);  }
@Test public void testExtract() { Resource head = vf.createBNode(); Model m = RDFCollections.asRDF(values, head, new TreeModel()); m.add(RDF.TYPE, RDF.TYPE, RDF.PROPERTY); Model collection = RDFCollections.getCollection(m, head, new TreeModel()); assertNotNull(collection); assertFalse(collection.contains(RDF.TYPE, RDF.TYPE, RDF.PROPERTY)); assertTrue(collection.contains(null, RDF.FIRST, a)); assertTrue(collection.contains(null, RDF.FIRST, b)); assertTrue(collection.contains(null, RDF.FIRST, c)); }