Code example for AtomicInteger

Methods: incrementAndGet

0
    ViewFinder finder = new ViewFinder(root);
    final AtomicInteger run = new AtomicInteger(0);
    finder.onCheck(new Runnable() {
 
      public void run() { 
        run.incrementAndGet();
      } 
    }, android.R.id.button1, android.R.id.button2);
    checkbox1.performClick();
    assertEquals(1, run.get());
    checkbox2.performClick();
    assertEquals(2, run.get());
  } 
 
  /** 
   * Verify on check helpers 
   */ 
  @Test 
  public void onCheckListener() { 
    CheckBox checkbox = new CheckBox(new Activity());
    checkbox.setId(android.R.id.button1);