コード例 #1
0
 public void testWithGet() {
   assertEquals(new Integer(0), evenNumbers.get(0));
   assertEquals(new Integer(2), evenNumbers.get(1));
   assertEquals(new Integer(4), evenNumbers.get(2));
   assertNull(evenNumbers.get(3));
 }
コード例 #2
0
 public void testWithNext() {
   assertEquals(new Integer(0), evenNumbers.next());
   assertEquals(new Integer(2), evenNumbers.next());
   assertEquals(new Integer(4), evenNumbers.next());
   assertNull(evenNumbers.next());
 }