Its easier to understand if the logic for omit empty sequences is a filtering iterator

@param splitted - the results of a splittingIterator

@return iterator with no empty values
492124
private Iterator<String> filterOutEmptyStrings(final Iterator<String> splitted) {
        return new Iterator<String>() {
            String next = getNext();
            @Override
            public boolean hasNext() {
                return next != null;
            }

            @Override
            public String next() {
                if ( !hasNext() ) throw new NoSuchElementException();
                String result = next;
                next = getNext();
                return result;
            }

            public String getNext() {
                while (splitted.hasNext()) {
                    String value = splitted.next();
                    if ( value != null && !value.isEmpty() ) {
                        return value;
                    }
                }
                return null;
            }

            @Override
            public void remove() {
                throw new UnsupportedOperationException();
            }
        };
    }
825093
public static List<String> splitString( String string, int limit ) {
        List<String> list = new ArrayList<String>();

        char[] chars = string.toCharArray();
        boolean endOfString = false;
        int start = 0;
        int end = start;
        while( start < chars.length - 1 ) {
            int charCount = 0;
            int lastSpace = 0;
            while( charCount < limit ) {
                if (chars[charCount + start] == ' ') {
                    lastSpace = charCount;
                }
                charCount++;
                if (charCount + start == string.length()) {
                    endOfString = true;
                    break;
                }
            }
            end = endOfString ? string.length() : (lastSpace > 0) ? lastSpace + start : charCount + start;
            list.add(string.substring(start, end));
            start = end + 1;
        }
        return list;
    }
493827
private void splitAt(long t) {
        if (data.containsKey(t)) return; // already split at this timestamp

        SortedMap<Long, int[]> head = data.headMap(t);

        int v = head.isEmpty() ? 0 : data.get(head.lastKey())[0];
        data.put(t, new int[]{v});
    }
383898
private List<byte[]> splitBytes(byte[] array, byte delimiter) {
		List<byte[]> byteArrays = new ArrayList<byte[]>();
		int begin = 0;

		for (int i = 0; i < array.length; i++) {
			// first find delimiter.
			while (i < array.length && array[i] != delimiter) {
				i++;
			}
			byteArrays.add(Arrays.copyOfRange(array, begin, i));
			begin = i + 1;
		}
		return byteArrays;
	}
1264013
public static List<String> splitTrim(String str, char separator, boolean ignoreEmpty){
		return split(str, separator, 0, true, ignoreEmpty);
	}
916002
public List<String> splitMatches(String text, int minSize) {
    TrieNode node = inner.root();
    List<String> matches = new ArrayList<>();
    String accumulator = "";
    for (int i = 0; i < text.length(); i++) {
      short prevDepth = node.getDepth();
      TrieNode prevNode = node;
      node = node.getContinuation(text.charAt(i));
      if (null == node) node = inner.root();
      if (!accumulator.isEmpty() && (node.getDepth() < prevDepth || (prevNode.hasChildren() && node.getDepth() == prevDepth))) {
        if (accumulator.length() > minSize) {
          matches.add(accumulator);
          node = ((Optional<TrieNode>) inner.root().getChild(text.charAt(i))).orElse(inner.root());
        }
        accumulator = "";
      }
      else if (!accumulator.isEmpty()) {
        accumulator += text.charAt(i);
      }
      else if (accumulator.isEmpty() && node.getDepth() > prevDepth) {
        accumulator = node.getString();
      }
    }
    List<String> tokenization = new ArrayList<>();
    for (String match : matches) {
      int index = text.indexOf(match);
      assert (index >= 0);
      if (index > 0) tokenization.add(text.substring(0, index));
      tokenization.add(text.substring(index, index + match.length()));
      text = text.substring(index + match.length());
    }
    tokenization.add(text);
    return tokenization;
  }
63127
public final Tuple2<Tuple0, Tuple5<T1, T2, T3, T4, T5>> split0() {
        return new Tuple2<>(limit0(), skip0());
    }
747261
@Override
  public List<? extends BoundedSource<T>> split(long desiredBundleSizeBytes,
      PipelineOptions options) throws Exception {

    List<? extends BoundedSource<T>> splits = delegate.split(desiredBundleSizeBytes, options);
    Collections.shuffle(splits);
    return splits;
  }
932018
protected Collection<String> normalize(String string, final boolean tokenize) {
        if (string == null) {
            return Collections.emptyList();
        }
        if (tokenize) {
            final Collection<String> result = new LinkedHashSet<>();

            result.addAll(normalize(string, false));

            final Splitter splitter = Splitter.on(' ').omitEmptyStrings();
            final List<String> tokens = splitter.splitToList(string);
            for (final String token : tokens) {
                final Collection<String> normalizedTokens = normalize(token, false);
                result.addAll(normalizedTokens);
            }
            return result;
        } else {
            string = StringUtils.replaceWhitespaces(string, "");
            string = StringUtils.replaceAll(string, "-", "");
            string = StringUtils.replaceAll(string, "_", "");
            string = StringUtils.replaceAll(string, "|", "");
            string = StringUtils.replaceAll(string, "*", "");
            string = string.toUpperCase();
            if (string.isEmpty()) {
                return Collections.emptyList();
            }
            final String withoutNumbers = string.replaceAll("[0-9]", "");
            if (withoutNumbers.equals(string) || withoutNumbers.isEmpty()) {
                return Arrays.asList(string);
            }
            return Arrays.asList(string, withoutNumbers);
        }
    }
1187290
def splititer(self, string, *args, **kwargs):
        """"""

        return self._pattern.splititer(string, *args, **kwargs)
629993
static List<String> split(String input)
    {
        if (input.isEmpty())
            return Collections.<String>emptyList();

        List<String> res = new ArrayList<String>();
        int prev = 0;
        for (int i = 0; i < input.length(); i++)
        {
            if (input.charAt(i) != ':' || (i > 0 && input.charAt(i-1) == '\\'))
                continue;

            res.add(input.substring(prev, i));
            prev = i + 1;
        }
        res.add(input.substring(prev, input.length()));
        return res;
    }
1318227
public static List<String> splitNicelyWithPattern( String toSplit, String patternSeparator ) {

		if( patternSeparator == null || patternSeparator.isEmpty())
			throw new IllegalArgumentException( "The separator cannot be null or the empty string." );

		List<String> result = new ArrayList<> ();
		if( ! Utils.isEmptyOrWhitespaces( toSplit )) {
			for( String s : toSplit.split( patternSeparator ))
				result.add( s .trim());
		}

		return result;
	}
544882
public static List<String> split(@Nullable final String str, final char separatorChar, int expectParts) {
		if (str == null) {
			return null;
		}

		final int len = str.length();
		if (len == 0) {
			return ListUtil.emptyList();
		}

		final List<String> list = new ArrayList<String>(expectParts);
		int i = 0;
		int start = 0;
		boolean match = false;
		while (i < len) {
			if (str.charAt(i) == separatorChar) {
				if (match) {
					list.add(str.substring(start, i));
					match = false;
				}
				start = ++i;
				continue;
			}
			match = true;
			i++;
		}
		if (match) {
			list.add(str.substring(start, i));
		}
		return list;
	}
1109216
public static String[] split(String src, String separator) {
        if (isEmpty(separator)) {
            return new String[] { src };
        }
        if (isEmpty(src)) {
            return StringUtils.EMPTY_STRING_ARRAY;
        }
        return src.split(separator, -1);
    }
640054
private <T> Iterator<T> emptyIt() {
        return new Iterator<T>() {
            @Override
            public boolean hasNext() {
                return false;
            }
            @Override
            public T next() {
                return null;
            }
        };
    }
648991
static <T> Spliterator<T> singletonSpliterator(final T element) {
        return new Spliterator<T>() {
            long est = 1;

            @Override
            public Spliterator<T> trySplit() {
                return null;
            }

            @Override
            public boolean tryAdvance(Consumer<? super T> consumer) {
                Objects.requireNonNull(consumer);
                if (est > 0) {
                    est--;
                    consumer.accept(element);
                    return true;
                }
                return false;
            }

            @Override
            public void forEachRemaining(Consumer<? super T> consumer) {
                tryAdvance(consumer);
            }

            @Override
            public long estimateSize() {
                return est;
            }

            @Override
            public int characteristics() {
                int value = (element != null) ? Spliterator.NONNULL : 0;

                return value | Spliterator.SIZED | Spliterator.SUBSIZED | Spliterator.IMMUTABLE |
                       Spliterator.DISTINCT | Spliterator.ORDERED;
            }
        };
    }
254820
public static List<String> splitAsList(Pattern splitPattern, String text) {
        return splitAsStream(splitPattern, text).collect(toList());
    }