/** * Create and refresh a new {@link ApplicationContext} based on the current state of * this loader. The context is consumed by the specified {@code consumer} and closed * upon completion. * @param consumer the consumer of the created {@link ApplicationContext} * @return this instance */ @SuppressWarnings("unchecked") public SELF run(ContextConsumer<? super A> consumer) { withContextClassLoader(this.classLoader, () -> { this.systemProperties.applyToSystemProperties(() -> { try (A context = createAssertableContext()) { accept(consumer, context); } return null; }); }); return (SELF) this; }