private SubmissionResult compileWithTestsAndRun(Submission submission) {
        CompilationResult compilation;
        try {
            compilation = compileWithTests(submission);
        } catch (CodeStyleException e) {
            SubmissionResult result = new SubmissionResult();
            result.setPass(false);
            result.getCompilationErrors().add(e.getMessage());
            return result;
        }
        if (compilation.passed()) {
            return run(compilation);
        } else {
            return compilation.asSubmissionResult();
        }
    }