@Override
        public Gram next() {
            Gram currentGram = nextGram;
            if (currentGram == null)
                currentGram = findNext();
            if (currentGram == null)
                throw new NoSuchElementException("No next gram at position " + i);
            nextGram = null;
            return currentGram;
        }
The next gram or null if not determined yet
linguistics/src/main/java/com/yahoo/language/process/GramSplitter.java