Code example for AtomicInteger

Methods: incrementAndGet

0
    } 
 
    @Override 
    public boolean eval(Row row)
    { 
      counter.incrementAndGet();
      return value;
    } 
  } 
 
  @Test 
  public void testAndHavingSpecShouldSupportShortcutEvaluation () { 
    AtomicInteger counter = new AtomicInteger(0);
    AndHavingSpec spec = new AndHavingSpec(ImmutableList.of(
      (HavingSpec)new CountingHavingSpec(counter, true),
      new CountingHavingSpec(counter, false),
      new CountingHavingSpec(counter, true),
      new CountingHavingSpec(counter, false)
    )); 
 
    spec.eval(ROW);