}
@Test
public void testFilePointerCombineDisjoint() {
FilePointer one = new FilePointer(IntervalMergingRule.ALL, genomeLocParser.createGenomeLoc("chr1",1,5));
one.addFileSpans(readerID,new GATKBAMFileSpan(new GATKChunk(0,1)));
FilePointer two = new FilePointer(IntervalMergingRule.ALL, genomeLocParser.createGenomeLoc("chr1",6,10));
two.addFileSpans(readerID,new GATKBAMFileSpan(new GATKChunk(1,2)));
FilePointer result = new FilePointer(IntervalMergingRule.ALL, genomeLocParser.createGenomeLoc("chr1",1,10));
result.addFileSpans(readerID,new GATKBAMFileSpan(new GATKChunk(0,2)));
Assert.assertEquals(one.combine(genomeLocParser,two),result,"Combination of two file pointers is incorrect");
Assert.assertEquals(two.combine(genomeLocParser,one),result,"Combination of two file pointers is incorrect");
//Now test that adjacent (but disjoint) intervals are properly handled with OVERLAPPING_ONLY
one = new FilePointer(IntervalMergingRule.OVERLAPPING_ONLY, genomeLocParser.createGenomeLoc("chr1",1,5));
one.addFileSpans(readerID,new GATKBAMFileSpan(new GATKChunk(0,1)));
two = new FilePointer(IntervalMergingRule.OVERLAPPING_ONLY, genomeLocParser.createGenomeLoc("chr1",6,10));
two.addFileSpans(readerID,new GATKBAMFileSpan(new GATKChunk(1,2)));
result = new FilePointer(IntervalMergingRule.OVERLAPPING_ONLY,
genomeLocParser.createGenomeLoc("chr1",1,5),
genomeLocParser.createGenomeLoc("chr1",6,10));
result.addFileSpans(readerID,new GATKBAMFileSpan(new GATKChunk(0,2)));
Assert.assertEquals(one.combine(genomeLocParser,two),result,"Combination of two file pointers is incorrect");
Assert.assertEquals(two.combine(genomeLocParser,one),result,"Combination of two file pointers is incorrect");
}