code: public static Map<String, AtomicInteger> tokenize(String string) {
          Map<String, AtomicInteger> result = new HashMap<String, AtomicInteger>();
          String[] tokens = string.split("\\s");  // regular expression for "all whitespace"
          for (String token : tokens) {
              // For some reasons, sometimes split() creates empty values.
              if (token.length() == 0) {
                  continue;
              }
  
              // Tokens are returned down-cased.
              String tokenDown = token.toLowerCase();
              AtomicInteger count = result.get(tokenDown);
              if (count == null) {
                  result.put(tokenDown, new AtomicInteger(1));
              } else {
                  count.incrementAndGet();
              }
          }
          return result;
      }
docs: Parse the given string and return a list of the whitespace-delimited tokens that it
  contains mapped to the number of occurrences of each token. Only whitespace
  characters (SP, CR, LF, TAB, FF, VT) are used to delimit tokens.
  
  @param string    String to be tokenized.
  @return          Map of tokens to occurrence counts.