@Test
public void testResolveBreak() throws Exception {

    String data[][] = {
            {"Harry", "Maryville High School", "ns:people.person.education..education.education.institution", "[X] graduate from [Y] [1-nsubj-0,1-prep-2,2-pobj-3]", "/person", "/organization/educational_institution", "0.831425"},
            {"Harry", "Maryville High School", "ns:people.person.education..education.education.institution", "[X] graduate from [Y] [1-nsubj-0,1-prep-2,2-pobj-3]", "/person", "/organization", "0.831425"},
            {"Harry", "Maryville High School", "ns:location.location.contains", "[X] graduate from [Y] [1-nsubj-0,1-prep-2,2-pobj-3]", "/location", "/location", "0.023784"},
            {"Harry", "Maryville High School", "ns:people.person.employment_history..business.employment_tenure.company", "[X] graduate from [Y] [1-nsubj-0,1-prep-2,2-pobj-3]", "/person", "/business/employer", "0.017617"},
            {"Harry", "University of Tennessee", "ns:education.educational_degree.people_with_this_degree..education.education.institution", "[X] degree from [Y] [1-poss-0,1-prep-2,2-pobj-3]", "/education/educational_degree", "/organization/educational_institution", "0.848325"},
            {"Harry", "University of Tennessee", "ns:education.educational_degree.people_with_this_degree..education.education.institution", "[X] degree from [Y] [1-poss-0,1-prep-2,2-pobj-3]", "/education/educational_degree", "/organization", "0.848325"},
            {"Harry", "Mary", "ns:people.person.spouse_s..people.marriage.spouse", "[X] marry to [Y] [1-nsubjpass-0,1-prep-2,2-pobj-3]", "/person", "/person", "0.803797"},
            {"Harry", "law enforcement", "ns:people.person.employment_history..business.employment_tenure.company", "[X] retire from [Y] [1-nsubj-0,1-prep-2,2-pobj-3]", "/person", "/business/employer", "0.239114"},
            {"Harry", "law enforcement", "ns:military.military_person.service..military.military_service.military_force", "[X] retire from [Y] [1-nsubj-0,1-prep-2,2-pobj-3]", "/military/military_person", "/military", "0.152768"},
            {"Harry", "law enforcement", "ns:military.military_person.service..military.military_service.military_force", "[X] retire from [Y] [1-nsubj-0,1-prep-2,2-pobj-3]", "/military/military_person", "/organization", "0.152768"},
            {"Harry", "law enforcement", "ns:military.military_person.service..military.military_service.military_force", "[X] retire from [Y] [1-nsubj-0,1-prep-2,2-pobj-3]", "/person", "/military", "0.152768"},
            {"Harry", "law enforcement", "ns:military.military_person.service..military.military_service.military_force", "[X] retire from [Y] [1-nsubj-0,1-prep-2,2-pobj-3]", "/person", "/organization", "0.152768"},
            {"Harry", "law enforcement", "ns:government.politician.government_positions_held..government.government_position_held.governmental_body", "[X] retire from [Y] [1-nsubj-0,1-prep-2,2-pobj-3]", "/person/politician", "/government/government", "0.063100"},
            {"Harry", "law enforcement", "ns:government.politician.government_positions_held..government.government_position_held.governmental_body", "[X] retire from [Y] [1-nsubj-0,1-prep-2,2-pobj-3]", "/person", "/government/government", "0.063100"},
            {"Harry", "law enforcement", "ns:people.person.education..education.education.institution", "[X] retire from [Y] [1-nsubj-0,1-prep-2,2-pobj-3]", "/person", "/organization/educational_institution", "0.058118"},
            {"Harry", "law enforcement", "ns:people.person.education..education.education.institution", "[X] retire from [Y] [1-nsubj-0,1-prep-2,2-pobj-3]", "/person", "/organization", "0.058118"},
            {"Harry", "law enforcement", "ns:organization.organization_founder.organizations_founded", "[X] retire from [Y] [1-nsubj-0,1-prep-2,2-pobj-3]", "/organization/organization_founder", "/organization", "0.039852"},
            {"Harry", "law enforcement", "ns:organization.organization_founder.organizations_founded", "[X] retire from [Y] [1-nsubj-0,1-prep-2,2-pobj-3]", "/person", "/organization", "0.039852"},
            {"Harry", "law enforcement", "ns:spaceflight.astronaut.space_agency", "[X] retire from [Y] [1-nsubj-0,1-prep-2,2-pobj-3]", "/spaceflight/astronaut", "/spaceflight/space_agency", "0.036531"},
            {"Harry", "law enforcement", "ns:spaceflight.astronaut.space_agency", "[X] retire from [Y] [1-nsubj-0,1-prep-2,2-pobj-3]", "/spaceflight/astronaut", "/organization", "0.036531"},
            {"Harry", "law enforcement", "ns:spaceflight.astronaut.space_agency", "[X] retire from [Y] [1-nsubj-0,1-prep-2,2-pobj-3]", "/person", "/spaceflight/space_agency", "0.036531"},
            {"Harry", "law enforcement", "ns:spaceflight.astronaut.space_agency", "[X] retire from [Y] [1-nsubj-0,1-prep-2,2-pobj-3]", "/person", "/organization", "0.036531"},
            {"Harry", "law enforcement", "ns:law.judge.courts..law.judicial_tenure.court", "[X] retire from [Y] [1-nsubj-0,1-prep-2,2-pobj-3]", "/person", "/government_agency", "0.029889"},
            {"Harry", "law enforcement", "ns:business.board_member.organization_board_memberships..organization.organization_board_membership.organization", "[X] retire from [Y] [1-nsubj-0,1-prep-2,2-pobj-3]", "/business/board_member", "/organization", "0.029889"},
            {"Harry", "law enforcement", "ns:business.board_member.organization_board_memberships..organization.organization_board_membership.organization", "[X] retire from [Y] [1-nsubj-0,1-prep-2,2-pobj-3]", "/person", "/organization", "0.029889"},
            {"Harry", "law enforcement", "ns:sports.pro_athlete.teams..sports.sports_team_roster.team", "[X] retire from [Y] [1-nsubj-0,1-prep-2,2-pobj-3]", "/person/athlete", "/organization/sports_team", "0.018266"},
            {"Harry", "law enforcement", "ns:sports.pro_athlete.teams..sports.sports_team_roster.team", "[X] retire from [Y] [1-nsubj-0,1-prep-2,2-pobj-3]", "/person/athlete", "/organization", "0.018266"},
            {"Harry", "law enforcement", "ns:sports.pro_athlete.teams..sports.sports_team_roster.team", "[X] retire from [Y] [1-nsubj-0,1-prep-2,2-pobj-3]", "/person", "/organization/sports_team", "0.018266"},
            {"Harry", "law enforcement", "ns:sports.pro_athlete.teams..sports.sports_team_roster.team", "[X] retire from [Y] [1-nsubj-0,1-prep-2,2-pobj-3]", "/person", "/organization", "0.018266"}
    };
    ConstraintSolver.ConstraintSolverBuilder<String> builder = new ConstraintSolver.ConstraintSolverBuilder<>();
    for (String[] objects : data) {
        builder.add(objects[0], objects[1], objects[3],objects[2], objects[4],objects[5], Doubles.tryParse(objects[6]), 1, 1);
    }
    List<DetectedRelation<String>> detectedRelations = builder.build().solve(new PrintCollector(true));
    // sort
    Collections.sort(detectedRelations, new Comparator<DetectedRelation<String>>() {
        @Override
        public int compare(DetectedRelation<String> o1, DetectedRelation<String> o2) {
            return ComparisonChain.start()
                    .compare(o1.getLeft(), o2.getLeft())
                    .compare(o1.getRight(), o2.getRight())
                    .compare(o1.getEdge().getRelation(), o2.getEdge().getRelation())
                    .result();
        }
    });
    for (DetectedRelation<String> entry : detectedRelations) {
        LOG.info(entry.getLeft() + " -> " + entry.getRight() + "  " + entry.getEdge());
    }
    Assert.assertThat(detectedRelations.size(), is(3));
    Assert.assertThat(detectedRelations.get(0).getLeft(), is("Harry"));
    Assert.assertThat(detectedRelations.get(0).getRight(), is("Mary"));
    Assert.assertThat(detectedRelations.get(0).getEdge().getRelation(), is("ns:people.person.spouse_s..people.marriage.spouse"));
}