// Path: src/main/java/com/google/devtools/build/bfg/GraphProcessor.java
// static class GraphProcessorException extends RuntimeException {
//   GraphProcessorException(String message) {
//     super(message);
//   }
// }


import static com.google.common.truth.Truth.assertThat;
import static junit.framework.TestCase.fail;
import com.google.common.collect.ImmutableMap;
import com.google.common.graph.Graph;
import com.google.common.graph.GraphBuilder;
import com.google.common.graph.MutableGraph;
import com.google.devtools.build.bfg.GraphProcessor.GraphProcessorException;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Map;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
    Graph<Path> actual = ClassToSourceGraphConsolidator.map(graph, map);
    MutableGraph<Path> expected = newGraph(Path.class);
    expected.addNode(Paths.get("A.java"));

    assertEquivalent(actual, expected);
  }

  @Test
  public void classGraphWithOnlyOneClassResultingInSingleSourceFile() {
    MutableGraph<String> graph = newGraph(String.class);
    graph.addNode("com.A");

    Map<String, Path> map = ImmutableMap.of("com.A", Paths.get("A.java"));

    Graph<Path> actual = ClassToSourceGraphConsolidator.map(graph, map);
    MutableGraph<Path> expected = newGraph(Path.class);
    expected.addNode(Paths.get("A.java"));

    assertEquivalent(actual, expected);
  }

  @Test
  public void classGraphWithInnerClasses_throwsException() {
    MutableGraph<String> graph = newGraph(String.class);
    graph.putEdge("com.A$inner", "com.E");
    Map<String, Path> map =
        ImmutableMap.of("com.A", Paths.get("A.java"), "com.E", Paths.get("E.java"));
    try {
      ClassToSourceGraphConsolidator.map(graph, map);
      fail("Expected GraphProcessorException but nothing was thrown.");
// Path: src/main/java/com/google/devtools/build/bfg/GraphProcessor.java
// static class GraphProcessorException extends RuntimeException {
//   GraphProcessorException(String message) {
//     super(message);
//   }
// }


// Path: src/test/java/com/google/devtools/build/bfg/ClassToSourceGraphConsolidatorTest.java
import static com.google.common.truth.Truth.assertThat;
import static junit.framework.TestCase.fail;
import com.google.common.collect.ImmutableMap;
import com.google.common.graph.Graph;
import com.google.common.graph.GraphBuilder;
import com.google.common.graph.MutableGraph;
import com.google.devtools.build.bfg.GraphProcessor.GraphProcessorException;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Map;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

    Graph<Path> actual = ClassToSourceGraphConsolidator.map(graph, map);
    MutableGraph<Path> expected = newGraph(Path.class);
    expected.addNode(Paths.get("A.java"));

    assertEquivalent(actual, expected);
  }

  @Test
  public void classGraphWithOnlyOneClassResultingInSingleSourceFile() {
    MutableGraph<String> graph = newGraph(String.class);
    graph.addNode("com.A");

    Map<String, Path> map = ImmutableMap.of("com.A", Paths.get("A.java"));

    Graph<Path> actual = ClassToSourceGraphConsolidator.map(graph, map);
    MutableGraph<Path> expected = newGraph(Path.class);
    expected.addNode(Paths.get("A.java"));

    assertEquivalent(actual, expected);
  }

  @Test
  public void classGraphWithInnerClasses_throwsException() {
    MutableGraph<String> graph = newGraph(String.class);
    graph.putEdge("com.A$inner", "com.E");
    Map<String, Path> map =
        ImmutableMap.of("com.A", Paths.get("A.java"), "com.E", Paths.get("E.java"));
    try {
      ClassToSourceGraphConsolidator.map(graph, map);
      fail("Expected GraphProcessorException but nothing was thrown.");
    } catch (GraphProcessorException e) {