public static <T> void executeWith(ContextProvider<T> provider, ContextRunnable<T> runnable) { T context = provider.setup(); try { runnable.run(context); } finally { provider.cleanup(context); } }
public static <T> void executeWith(ContextProvider<T> provider, ContextRunnable<T> runnable) { T context = provider.setup(); try { runnable.run(context); } finally { provider.cleanup(context); } }