@Test
public void getBranchWithRecordAndWrongRecordTest() {

    // Setup:
    thrown.expect(IllegalArgumentException.class);
    thrown.expectMessage(String.format("Branch %s does not belong to VersionedRDFRecord %s", LONE_BRANCH_IRI, VERSIONED_RDF_RECORD_IRI));
    try (RepositoryConnection conn = repo.getConnection()) {
        VersionedRDFRecord record = versionedRDFRecordFactory.createNew(VERSIONED_RDF_RECORD_IRI);
        service.getBranch(record, LONE_BRANCH_IRI, branchFactory, conn);
    }
}