// Path: x_common/compiler-testing/src/main/java/org/zalando/techtalks/hackingjava/common/compiler/CompilationResult.java
// public final class CompilationResult {
// 
//     private final boolean success;
//     private final List<String> warnings;
//     private final List<String> errors;
// 
//     public boolean isSuccess() {
//         return success;
//     }
// 
//     public List<String> getWarnings() {
//         return Collections.unmodifiableList(warnings);
//     }
// 
//     public List<String> getErrors() {
//         return Collections.unmodifiableList(errors);
//     }
// 
//     public CompilationResult(final boolean success, final List<String> warnings, final List<String> errors) {
//         this.success = success;
//         this.warnings = new ArrayList<>(warnings);
//         this.errors = new ArrayList<>(errors);
//     }
// 
//     @Override
//     public int hashCode() {
//         return Objects.hash(success, warnings, errors);
//     }
// 
//     @Override
//     public boolean equals(final Object obj) {
//         if (this == obj) {
//             return true;
//         }
// 
//         if (obj == null || getClass() != obj.getClass()) {
//             return false;
//         }
// 
//         final CompilationResult other = (CompilationResult) obj;
//         return Objects.equals(this.success, other.success) && Objects.equals(this.warnings, other.warnings)
//                 && Objects.equals(this.errors, other.errors);
//     }
// 
//     @Override
//     public String toString() {
//         return "CompilationResult{" + "success=" + success + ", warnings=" + warnings + ", errors=" + errors + '}';
//     }
// }


import java.io.File;
import java.io.IOException;
import java.io.Writer;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Locale;
import javax.tools.Diagnostic;
import javax.tools.DiagnosticCollector;
import javax.tools.JavaCompiler;
import javax.tools.JavaFileObject;
import javax.tools.StandardJavaFileManager;
import javax.tools.StandardLocation;
import javax.tools.ToolProvider;
import org.zalando.techtalks.hackingjava.common.compiler.CompilationResult;
import static java.util.stream.Collectors.toList;
import static javax.tools.Diagnostic.Kind.ERROR;
import static javax.tools.Diagnostic.Kind.WARNING;
            compilerFlags.add(additionalFlag);
        }

        return this;
    }

    public CompilerRun setLocation(final StandardLocation location,
                                   final File firstPath,
                                   final File... morePaths) {
        try {
            final List<File> paths = new ArrayList<>(morePaths.length + 1);
            paths.add(firstPath);
            paths.addAll(Arrays.asList(morePaths));
            fileManager.setLocation(location, paths);
            return this;
        } catch (IOException e) {
            throw new IllegalStateException(e);
        }
    }

    public CompilerRun addAnnotationProcessor(final String annotationProcessor) {
        annotationProcessorClasses.add(annotationProcessor);
        return this;
    }

    public CompilerRun addAnnotationProcessor(final Class<?> annotationProcessor) {
        annotationProcessorClasses.add(annotationProcessor.getName());
        return this;
    }

// Path: x_common/compiler-testing/src/main/java/org/zalando/techtalks/hackingjava/common/compiler/CompilationResult.java
// public final class CompilationResult {
// 
//     private final boolean success;
//     private final List<String> warnings;
//     private final List<String> errors;
// 
//     public boolean isSuccess() {
//         return success;
//     }
// 
//     public List<String> getWarnings() {
//         return Collections.unmodifiableList(warnings);
//     }
// 
//     public List<String> getErrors() {
//         return Collections.unmodifiableList(errors);
//     }
// 
//     public CompilationResult(final boolean success, final List<String> warnings, final List<String> errors) {
//         this.success = success;
//         this.warnings = new ArrayList<>(warnings);
//         this.errors = new ArrayList<>(errors);
//     }
// 
//     @Override
//     public int hashCode() {
//         return Objects.hash(success, warnings, errors);
//     }
// 
//     @Override
//     public boolean equals(final Object obj) {
//         if (this == obj) {
//             return true;
//         }
// 
//         if (obj == null || getClass() != obj.getClass()) {
//             return false;
//         }
// 
//         final CompilationResult other = (CompilationResult) obj;
//         return Objects.equals(this.success, other.success) && Objects.equals(this.warnings, other.warnings)
//                 && Objects.equals(this.errors, other.errors);
//     }
// 
//     @Override
//     public String toString() {
//         return "CompilationResult{" + "success=" + success + ", warnings=" + warnings + ", errors=" + errors + '}';
//     }
// }


// Path: x_common/compiler-testing/src/main/java/org/zalando/techtalks/hackingjava/compilertesting/CompilerRun.java
import java.io.File;
import java.io.IOException;
import java.io.Writer;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Locale;
import javax.tools.Diagnostic;
import javax.tools.DiagnosticCollector;
import javax.tools.JavaCompiler;
import javax.tools.JavaFileObject;
import javax.tools.StandardJavaFileManager;
import javax.tools.StandardLocation;
import javax.tools.ToolProvider;
import org.zalando.techtalks.hackingjava.common.compiler.CompilationResult;
import static java.util.stream.Collectors.toList;
import static javax.tools.Diagnostic.Kind.ERROR;
import static javax.tools.Diagnostic.Kind.WARNING;

            compilerFlags.add(additionalFlag);
        }

        return this;
    }

    public CompilerRun setLocation(final StandardLocation location,
                                   final File firstPath,
                                   final File... morePaths) {
        try {
            final List<File> paths = new ArrayList<>(morePaths.length + 1);
            paths.add(firstPath);
            paths.addAll(Arrays.asList(morePaths));
            fileManager.setLocation(location, paths);
            return this;
        } catch (IOException e) {
            throw new IllegalStateException(e);
        }
    }

    public CompilerRun addAnnotationProcessor(final String annotationProcessor) {
        annotationProcessorClasses.add(annotationProcessor);
        return this;
    }

    public CompilerRun addAnnotationProcessor(final Class<?> annotationProcessor) {
        annotationProcessorClasses.add(annotationProcessor.getName());
        return this;
    }

    public CompilationResult compile() {