### Question:
EventsIterator implements Iterator<Serializable> { @Override public boolean hasNext() { return it != null; } EventsIterator(Iterator<T> cit); @Override boolean hasNext(); @Override Serializable next(); @Override void remove();  }### Answer:
@Test public void test_that_hasNext_is_false_at_end_of_changeset() { List<Integer> data = TestUtils.randomdata(1); ChangeSet cs = new DefaultChangeSet("BUCKET", "STREAM", 0, UUID.randomUUID().toString(), data); List<ChangeSet> lcs = new ArrayList<>(); lcs.add(cs); EventsIterator eit = new EventsIterator(lcs.iterator()); assertTrue(eit.hasNext()); TestUtils.compare(eit, lcs); }
@Test public void test_empty() { List<ChangeSet> lcs = new ArrayList<>(); for (int i = 0; i < 10; i++) { List<Integer> data = TestUtils.randomdata(0); assertEquals(data.size(), 0); ChangeSet cs = new DefaultChangeSet("BUCKET", "STREAM", 0, UUID.randomUUID().toString(), data); } EventsIterator eit = new EventsIterator(lcs.iterator()); assertTrue(!eit.hasNext()); TestUtils.compare(eit, lcs); }