code: private static String[] splitWorker(String str, char separatorChar, boolean preserveAllTokens) {
          // Performance tuned for 2.0 (JDK1.4)
  
          if (str == null) {
              return null;
          }
          int len = str.length();
          if (len == 0) {
              return ArrayUtils.EMPTY_STRING_ARRAY;
          }
          List list = new ArrayList();
          int i = 0, start = 0;
          boolean match = false;
          boolean lastMatch = false;
          while (i < len) {
              if (str.charAt(i) == separatorChar) {
                  if (match || preserveAllTokens) {
                      list.add(str.substring(start, i));
                      match = false;
                      lastMatch = true;
                  }
                  start = ++i;
                  continue;
              }
              lastMatch = false;
              match = true;
              i++;
          }
          if (match || (preserveAllTokens && lastMatch)) {
              list.add(str.substring(start, i));
          }
          return (String[]) list.toArray(new String[list.size()]);
      }
docs: Performs the logic for the <code>split</code> and
  <code>splitPreserveAllTokens</code> methods that do not return a
  maximum array length.
  
  @param str  the String to parse, may be <code>null</code>
  @param separatorChar the separate character
  @param preserveAllTokens if <code>true</code>, adjacent separators are
  treated as empty token separators; if <code>false</code>, adjacent
  separators are treated as one separator.
  @return an array of parsed Strings, <code>null</code> if null String input