RDFContainers { public static void extract(IRI containerType, Model sourceModel, Resource container, 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(containerType, statementSupplier, container, consumer, Models::modelException, contexts); }  static C toRDF(IRI containerType, Iterable<?> values, Resource container,
			C sink,
			Resource... contexts); static C toRDF(IRI containerType, Iterable<?> values, Resource container,
			C sink,
			ValueFactory vf, Resource... contexts); static C toValues(IRI containerType, final Model m, Resource container,
			C collection,
			Resource... contexts); static void consumeContainer(IRI containerType, Iterable<?> values, Resource container,
			Consumer<Statement> consumer,
			Resource... contexts); static void consumeContainer(IRI containerType, Iterable<?> values, Resource container,
			Consumer<Statement> consumer,
			ValueFactory vf, Resource... contexts); static void consumeValues(final Model m, Resource container, IRI containerType, Consumer<Value> consumer,
			Resource... contexts); static C getContainer(IRI containerType, Model sourceModel,
			Resource container, C sink,
			Resource... contexts); static void extract(IRI containerType, Model sourceModel, Resource container, Consumer<Statement> consumer,
			Resource... contexts); static void extract(IRI containerType, GetStatementOptional statementSupplier,
			Resource container,
			Consumer<Statement> collectionConsumer, Function<String, Supplier<E>> exceptionSupplier,
			Resource... contexts);  }
@Test public void testExtract() { Resource container = vf.createBNode(); Model m = RDFContainers.toRDF(RDF.BAG, values, container, new TreeModel()); m.add(RDF.TYPE, RDF.TYPE, RDF.PROPERTY); Model containerModel = RDFContainers.getContainer(RDF.BAG, m, container, new TreeModel()); assertNotNull(containerModel); assertFalse(containerModel.contains(RDF.TYPE, RDF.TYPE, RDF.PROPERTY)); }