docs: public static List<String> split( final String     src,
                                        final String     delim,
                                        final boolean    trim )
      {
          if ( delim == null )
          {
              throw new IllegalArgumentException( "delim cannot be null" );
          }
  
          //
          // Return an empty array if the string is null
          //
          if ( StringUtils.isBlank( src ) )
          {
              return Collections.emptyList();
          }
  
          List<String> list = new ArrayList<String>();
  
          //
          // Need to allow splitting strings by spaces
          // so we don't want to check for Blank strings
          // as well.
          //
          if ( delim.isEmpty() )
          {
              list.add( src );
              return list;
          }
  
          int delimLength = delim.length();
          int index = 0;
          int start = 0;
          String piece;
  
          while ( index < src.length() )
          {
              index = src.indexOf( delim, index );
  
              if ( index == -1 )
              {
                  break;
              }
  
              //
              // Add the substring to the list.
              //
              piece = src.substring( start, index );
  
              if ( trim )
              {
                  list.add( piece.trim() );
              }
              else
              {
                  list.add( piece );
              }
  
              //
              // Skip further along the buffer, past what we
              // replaced, so we don't end up possibly in an infinite
              // loop.
              //
              start = index + delimLength;
  
              index += delimLength;
          }
  
          //
          // Make sure the end of the string gets added.
          //
          if ( trim )
          {
              list.add( src.substring( start ).trim() );
          }
          else
          {
              list.add( src.substring( start ) );
          }
  
          //
          // Output a list, given our list contents.
          //
          return list;
      }