RDFContainers { public static <C extends Collection<Statement>> C toRDF(IRI containerType, Iterable<?> values, Resource container, C sink, Resource... contexts) { Objects.requireNonNull(sink); consumeContainer(containerType, values, container, st -> sink.add(st), contexts); return sink; }  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 testInjectedValueFactoryIsUsed() { Resource container = vf.createBNode(); ValueFactory injected = mock(SimpleValueFactory.class, CALLS_REAL_METHODS); RDFContainers.toRDF(RDF.BAG, values, container, new TreeModel(), injected); verify(injected, atLeastOnce()).createStatement(any(), any(), any()); }