@@ -0,0 +1,1427 @@
+package com.levelup.java.guava;%0A%0Aimport static org.junit.Assert.assertEquals;%0A%0Aimport java.util.List;%0A%0Aimport org.junit.Test;%0A%0Aimport com.google.common.base.CharMatcher;%0Aimport com.google.common.base.Splitter;%0A%0A/**%0A * This java snippet will demonstrate examples of %0A * Google Guava Splitter%0A * %0A * @author Justin Musgrove%0A * @see %3Ca href='http://www.leveluplunch.com/java/'%3E%3C/a%3E%0A * %0A */%0Apublic class SplitterExample %7B%0A%0A%09@Test%0A%09public void split_string_to_list_using_delimiter () %7B%0A%09%09%0A%09%09List%3CString%3E oakTrees =  %0A%09%09%09Splitter.on(',')%0A%09%09%09%09.trimResults()%0A%09%09%09%09.omitEmptyStrings()%0A%09%09%09%09.splitToList(%22Granit Oak, Bartek, Gernikako Arbola, Queen Elizabeth Oak, Kongeegen (the King Oak), Ch%C3%AAne chapelle, Poltava Oak,,,%22);%0A%09%09%0A%09%09assertEquals(7, oakTrees.size());%0A%09%7D%0A%09%0A%09@Test%0A%09public void split_string_to_list_using_charmatchers () %7B%0A%0A%09%09List%3CString%3E abcs123s = Splitter.on(CharMatcher.anyOf(%22;,.)%22))%0A%09%09%09%09.trimResults()%0A%09%09%09%09.omitEmptyStrings()%0A%09%09%09%09.splitToList(%22a,b;c.d,e.f),g,h.i;j.1,2.3;4.5,6;7.8,9;0%22);%0A%09%09%0A%09%09assertEquals(20, abcs123s.size());%0A%09%09%09%0A%09%7D%0A%09%0A%09@Test%0A%09public void split_string_using_regular_expresion () %7B%0A%09%09List%3CString%3E splitOnLetter = Splitter.onPattern(%22a%7Cb%22).splitToList(%2212312a31231b23123%22);%0A%0A%09%09assertEquals(3, splitOnLetter.size());%0A%09%7D%0A%09%0A%09@Test%0A%09public void split_string_to_list_using_fix_length () %7B%0A%09%09List%3CString%3E digits = Splitter.fixedLength(1).splitToList(%221234567890%22);%0A%09%09%0A%09%09assertEquals(10, digits.size());%0A%0A%09%7D%0A%09%0A%09%0A%7D%0A

add guava splitter example