@Test(expectedExceptions = UserException.CommandLineException.class)
 public void testNoArgs() throws Exception {
   // making sure that this blows up in a very specific way (UserException.CommandLineException) if
   // we give bogus arguments
   final ArgumentsBuilder args = new ArgumentsBuilder();
   this.runCommandLine(args.getArgsArray());
 }
 @Test(dataProvider = "filenames")
 public void testCountReads(final String fileIn, final String referenceName) throws Exception {
   final File ORIG_BAM = new File(getTestDataDir(), fileIn);
   final ArgumentsBuilder args = new ArgumentsBuilder();
   args.add("--input");
   args.add(ORIG_BAM.getAbsolutePath());
   if (null != referenceName) {
     final File REF = new File(getTestDataDir(), referenceName);
     args.add("-R");
     args.add(REF.getAbsolutePath());
   }
   final Object res = this.runCommandLine(args.getArgsArray());
   Assert.assertEquals(res, 8l);
 }
  private void countReads(
      final String interval_args,
      final String fileName,
      final String referenceName,
      final long count) {
    final File ORIG_BAM = new File(getTestDataDir(), fileName);
    final ArgumentsBuilder args = new ArgumentsBuilder();
    args.add("--input");
    args.add(ORIG_BAM.getAbsolutePath());
    if (null != referenceName) {
      final File REF = new File(getTestDataDir(), referenceName);
      args.add("-R");
      args.add(REF.getAbsolutePath());
    }
    args.add(interval_args);

    final Object res = this.runCommandLine(args.getArgsArray());
    Assert.assertEquals(res, count);
  }