code: public static Iterator<List<TermOccurrence>> occurrenceChunkIterator(Collection<TermOccurrence> occurrences) {
  		List<TermOccurrence> asList = Lists.newArrayList(occurrences);
  		Collections.sort(asList, TermOccurrenceUtils.uimaNaturalOrder);
  		final Iterator<TermOccurrence> it = asList.iterator();
  		return new AbstractIterator<List<TermOccurrence>>() {
  			private List<TermOccurrence> currentChunk = Lists.newArrayList();
  			
  			@Override
  			protected List<TermOccurrence> computeNext() {
  				while(it.hasNext()) {
  					TermOccurrence next = it.next();
  					if(currentChunk.isEmpty() || hasOverlappingOffsets(next, currentChunk))
  						currentChunk.add(next);
  					else {
  						List<TermOccurrence> ret = copyAndReinit();
  						currentChunk.add(next);
  						return ret;	
  					}
  				} 
  				if(!currentChunk.isEmpty()) {
  					return copyAndReinit();
  				} else 
  					return endOfData();
  			}
  
  			private List<TermOccurrence> copyAndReinit() {
  				List<TermOccurrence> copy = Lists.newArrayList(currentChunk);
  				currentChunk = Lists.newArrayList();
  				return copy;
  			}
  		};
  	}
docs: Returns a virtual iterator on chunks of an occurrence collection.
  
  A occurrence collection's chunk is a list of overlapping {@link TermOccurrence}. Every time
  there is a gap between two occurrences (i.e. there do not overlap),
  a new chunk is created.
  
  @param occurrences
  @return