public void testStepByOneWithClosure(){
  final List callLog=new ArrayList();
  final Closure closure=new RecordingClosure(callLog);
  final Range range=createRange(1,5);
  range.step(1,closure);
  assertEquals("wrong number of calls to closure",5,callLog.size());
  final Iterator iter=callLog.iterator();
  for (int i=1; i <= 5; i++) {
    assertEquals("wrong argument passed to closure",createValue(i),iter.next());
  }
}

public void testStepByOneWithClosure ( ) { final List callLog = new ArrayList ( ) ; final Closure closure = new RecordingClosure ( callLog ) ; final Range range = createRange ( 1 , 5 ) ; range . step ( 1 , closure ) ; assertEquals ( "wrong number of calls to closure" , 5 , callLog . size ( ) ) ; final Iterator iter = callLog . iterator ( ) ; for ( int i = 1 ; i <= 5 ; i ++ ) { assertEquals ( "wrong argument passed to closure" , createValue ( i ) , iter . next ( ) ) ; } }
tests stepping through a range with a closure .
