@Override default ExecutorEnvironment newExecutorEnvironment() throws Exception { final Executor executor = SparkExecutor.newBuilder("test") .local() .allowMultipleContexts() .kryoRegistrator(TestRegistrator.class) .build(); return new ExecutorEnvironment() { @Override public Executor getExecutor() { return executor; } @Override public void shutdown() throws Exception { executor.shutdown(); } }; } }