// Path: src/main/java/com/google/testing/compile/Parser.java
// static final class ParseResult {
//   private final ImmutableListMultimap<Diagnostic.Kind, Diagnostic<? extends JavaFileObject>>
//       diagnostics;
//   private final ImmutableList<? extends CompilationUnitTree> compilationUnits;
//   private final Trees trees;
// 
//   ParseResult(
//       ImmutableListMultimap<Diagnostic.Kind, Diagnostic<? extends JavaFileObject>> diagnostics,
//       Iterable<? extends CompilationUnitTree> compilationUnits,
//       Trees trees) {
//     this.trees = trees;
//     this.compilationUnits = ImmutableList.copyOf(compilationUnits);
//     this.diagnostics = diagnostics;
//   }
// 
//   ImmutableListMultimap<Diagnostic.Kind, Diagnostic<? extends JavaFileObject>>
//       diagnosticsByKind() {
//     return diagnostics;
//   }
// 
//   ImmutableList<? extends CompilationUnitTree> compilationUnits() {
//     return compilationUnits;
//   }
// 
//   Trees trees() {
//     return trees;
//   }
// }


import static com.google.common.collect.Iterables.getOnlyElement;
import static com.google.common.truth.Truth.assertThat;
import com.google.common.collect.ImmutableList;
import com.google.testing.compile.Parser.ParseResult;
import com.sun.source.tree.CompilationUnitTree;
import com.sun.source.tree.Tree;
import com.sun.source.util.TreePath;
import java.util.Objects;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
  @Test
  public void scan_testLambdaVersusMethodReference() {
    TreeDifference diff =
        TreeDiffer.diffCompilationUnits(LAMBDA_1, METHOD_REFERENCE);
    assertThat(diff.isEmpty()).isFalse();
  }

  @Test
  public void scan_testLambdaVersusAnonymousClass() {
    TreeDifference diff =
        TreeDiffer.diffCompilationUnits(LAMBDA_1, ANONYMOUS_CLASS);
    assertThat(diff.isEmpty()).isFalse();
  }

  @Test
  public void scan_testTryWithResources() {
    TreeDifference diff =
        TreeDiffer.diffCompilationUnits(TRY_WITH_RESOURCES_1, TRY_WITH_RESOURCES_1);
    assertThat(diff.isEmpty()).isTrue();
  }

  @Test
  public void scan_testTryWithResourcesDifferent() {
    TreeDifference diff =
        TreeDiffer.diffCompilationUnits(TRY_WITH_RESOURCES_1, TRY_WITH_RESOURCES_2);
    assertThat(diff.isEmpty()).isFalse();
  }

  @Test
  public void matchCompilationUnits() {
// Path: src/main/java/com/google/testing/compile/Parser.java
// static final class ParseResult {
//   private final ImmutableListMultimap<Diagnostic.Kind, Diagnostic<? extends JavaFileObject>>
//       diagnostics;
//   private final ImmutableList<? extends CompilationUnitTree> compilationUnits;
//   private final Trees trees;
// 
//   ParseResult(
//       ImmutableListMultimap<Diagnostic.Kind, Diagnostic<? extends JavaFileObject>> diagnostics,
//       Iterable<? extends CompilationUnitTree> compilationUnits,
//       Trees trees) {
//     this.trees = trees;
//     this.compilationUnits = ImmutableList.copyOf(compilationUnits);
//     this.diagnostics = diagnostics;
//   }
// 
//   ImmutableListMultimap<Diagnostic.Kind, Diagnostic<? extends JavaFileObject>>
//       diagnosticsByKind() {
//     return diagnostics;
//   }
// 
//   ImmutableList<? extends CompilationUnitTree> compilationUnits() {
//     return compilationUnits;
//   }
// 
//   Trees trees() {
//     return trees;
//   }
// }


// Path: src/test/java/com/google/testing/compile/TreeDifferTest.java
import static com.google.common.collect.Iterables.getOnlyElement;
import static com.google.common.truth.Truth.assertThat;
import com.google.common.collect.ImmutableList;
import com.google.testing.compile.Parser.ParseResult;
import com.sun.source.tree.CompilationUnitTree;
import com.sun.source.tree.Tree;
import com.sun.source.util.TreePath;
import java.util.Objects;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

  @Test
  public void scan_testLambdaVersusMethodReference() {
    TreeDifference diff =
        TreeDiffer.diffCompilationUnits(LAMBDA_1, METHOD_REFERENCE);
    assertThat(diff.isEmpty()).isFalse();
  }

  @Test
  public void scan_testLambdaVersusAnonymousClass() {
    TreeDifference diff =
        TreeDiffer.diffCompilationUnits(LAMBDA_1, ANONYMOUS_CLASS);
    assertThat(diff.isEmpty()).isFalse();
  }

  @Test
  public void scan_testTryWithResources() {
    TreeDifference diff =
        TreeDiffer.diffCompilationUnits(TRY_WITH_RESOURCES_1, TRY_WITH_RESOURCES_1);
    assertThat(diff.isEmpty()).isTrue();
  }

  @Test
  public void scan_testTryWithResourcesDifferent() {
    TreeDifference diff =
        TreeDiffer.diffCompilationUnits(TRY_WITH_RESOURCES_1, TRY_WITH_RESOURCES_2);
    assertThat(diff.isEmpty()).isFalse();
  }

  @Test
  public void matchCompilationUnits() {
    ParseResult actual =