@Test
public void testSolve() throws Exception {

    ConstraintSolver.ConstraintSolverBuilder<String> solverBuilder = new ConstraintSolver.ConstraintSolverBuilder<>();
    solverBuilder.add("E1", "E2", "x -> y", "1", "A", "D", 1, 1, 1);
    solverBuilder.add("E1", "E2", "x -> y", "2", "A#", "D", 3, 1, 1);
    solverBuilder.add("E2", "E3", "x -> y", "3", "D", "B", 1, 1, 1);
    solverBuilder.add("E1", "E3", "x -> y", "4", "A", "B", 1, 1, 1);
    solverBuilder.add("E3", "E4", "x -> y", "5", "B", "C", 1, 1, 1);
    PrintCollector printCollector = new PrintCollector(true);
    final List<DetectedRelation<String>> solve = solverBuilder.build().solve(printCollector);
    assertNotNull(solve);
    assertThat(solve.size(), is(4));
    assertThat(solve.get(0).getEdge(), is(new Edge(1, "1", "x -> y", "A", "D", 1, 1, 1, false)));
    assertThat(solve.get(1).getEdge(), is(new Edge(4, "4", "x -> y", "A", "B", 1, 1, 1, false)));
    assertThat(solve.get(2).getEdge(), is(new Edge(3, "3", "x -> y", "D", "B", 1, 1, 1, false)));
    assertThat(solve.get(3).getEdge(), is(new Edge(5, "5", "x -> y", "B", "C", 1, 1, 1, false)));
    printCollector.print(Joiner.on("\n").join(solve));
    printCollector.print(Graph.transform(solve).toString());
}