    @Test
    public void parseChain_parseCorrectly() throws Exception {

        BitbucketPullRequest firstPr = createPr("a", "master");
        BitbucketPullRequest secondPr = createPr("b", "a");
        BitbucketPullRequests pullRequests = new BitbucketPullRequests();
        pullRequests.setPullRequests(asList(secondPr, firstPr));

        parser.parsePullRequestChains(pullRequests);

        assertEquals(1, firstPr.getBranchChain().size());
        assertEquals(2, secondPr.getBranchChain().size());
        assertTrue(firstPr.getBranchChain().contains("master"));
        assertTrue(secondPr.getBranchChain().containsAll(asList("a", "master")));
    }