@Test
  public void testMultipleConcordantMappings() throws Exception {
    File testInput = new File(getClass().getResource("4f9f9_fix.txt").getFile());
    String content = new Scanner(testInput).useDelimiter("\\Z").next();
    String key = content.substring(0, content.indexOf("\t"));
    String val = content.substring(content.indexOf("\t") + 1);

    MockOutputCollector mockOutputCollector = new MockOutputCollector();
    mapper.setAlignmentReader(new SAMAlignmentReader());
    mapper.setFaix(
        new FaidxFileHelper("foo") {
          @Override
          public Short getKeyForChromName(String name) throws IOException {
            assertEquals("2", name);
            return (short) 9;
          }
        });
    mapper.setMaxInsertSize(2500);
    mapper.setTargetIsize(300);
    mapper.setTargetIsizeSD(30);
    mapper.map(new Text(key), new Text(val), mockOutputCollector, null);

    assertEquals(9, mockOutputCollector.keys.size());
    assertEquals(new HashSet(mockOutputCollector.keys).size(), mockOutputCollector.keys.size());
  }
  @Test
  public void testMap_real1() throws Exception {
    String key = "@2_132385096_132385222_0_1_0_0_1:0:0_1:0:0_1bfnjd/";
    String val =
        "@2_132385096_132385222_0_1_0_0_1:0:0_1:0:0_1bfnjd//1\tS\tTAAAAAGCCGCGGCGACTAAAAGCCGCTGAGAGGGGGCAAAAAGCAGCGG\t66554410000////1.0000/----,/,.,.,,++++-----+*-****\tU\t25\t139.09267\t>2\t132512583\tF\t.\t.\t.\t18A>T\tCB_READ\t@2_132385096_132385222_0_1_0_0_1:0:0_1:0:0_1bfnjd//2\tS\tCCCCTGCCCCGCCGCGGCTTTTTGCGGCTTTCCGCCCCGGCCGCCGCGGA\t33324110000////...000//---,,...,,,++++++++++*****,\tU\t23\t135.68983\t>2\t132512814\tR\t.\t.\t.\t1G>T";

    mapper.setFaix(
        new FaidxFileHelper("foo") {
          @Override
          public Short getKeyForChromName(String name) throws IOException {
            assertEquals("2", name);
            return (short) 0;
          }
        });

    MockOutputCollector mockOutputCollector = new MockOutputCollector();
    mapper.map(new Text(key), new Text(val), mockOutputCollector, null);
    mapper.setChromosomeFilter("2");
    mapper.setStartFilter(132512600l);
    mapper.setEndFilter(132512800l);

    GenomicLocationWithQuality gl132512700 = new GenomicLocationWithQuality();
    gl132512700.chromosome = 0;
    gl132512700.pos = 132512700;
    gl132512700.pMappingCorrect = -3.9301895071730983E-14;

    assertTrue(mockOutputCollector.keys.contains(gl132512700));
    assertEquals(281, mockOutputCollector.values.get(0).insertSize);
  }
 @Before
 public void setup() {
   mapper = new AlignmentsToReadPairInfoMapper();
   mapper.setScorer(new ProbabilisticPairedAlignmentScorer());
   mapper.setAlignmentReader(new NovoalignAlignmentReader());
   mapper.setResolution(100);
   mapper.setFaix(
       new FaidxFileHelper("foo") {
         @Override
         public Short getKeyForChromName(String name) throws IOException {
           assertEquals("10", name);
           return (short) 9;
         }
       });
 }