Example #1
0
 @Test
 public void test_hasNext_0() {
   List<Integer> list = new ArrayList<Integer>();
   Cursor<Integer> it = new Cursor<Integer>(list);
   assertEquals("[].hasNext #1", false, it.hasNext());
   assertEquals("[].hasNext #2", false, it.hasNext());
 }
Example #2
0
 @Test
 public void test_next() {
   List<Integer> list = new ArrayList<Integer>();
   list.add(1);
   list.add(2);
   Cursor<Integer> it = new Cursor<Integer>(list);
   assertEquals("[1,2].next", 1, (Object) it.next());
   assertEquals("[2].next", 2, (Object) it.next());
 }
Example #3
0
 @Test
 public void test_hasNext_1() {
   List<Integer> list = new ArrayList<Integer>();
   list.add(1);
   Cursor<Integer> it = new Cursor<Integer>(list);
   assertEquals("[1].hasNext #1", true, it.hasNext());
   assertEquals("[1].hasNext #2", true, it.hasNext());
   it.next();
   assertEquals("[].hasNext #1", false, it.hasNext());
   assertEquals("[].hasNext #2", false, it.hasNext());
 }
Example #4
0
 @Test
 public void test_clone() {
   List<Integer> list = new ArrayList<Integer>();
   list.add(1);
   list.add(2);
   Cursor<Integer> it = new Cursor<Integer>(list);
   it.next();
   Cursor<Integer> it2 = it.clone();
   assertEquals("clone+hasNext #1", true, (Object) it2.hasNext());
   assertEquals("clone+next #1", 2, (Object) it2.next());
 }