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