@Override
    public T next() {
        if (!hasNext()) {
            throw new NoSuchElementException();
        }

        counter++;
        return currentIterator.next();
    }
@Test
	public void testNextWithEmpty() {
		Assertions.assertThrows(NoSuchElementException.class, () -> {
			List<Integer> emptyList = new ArrayList<Integer>();
			CompositeIterable<Integer> compositeIterable = new CompositeIterable<Integer>(
					emptyList);
			compositeIterable.iterator().next();
		});
	}