docs: public static String firstWord(String sentence)
    {
      if(sentence == null) {
        return null;
      }
      if(sentence.isEmpty()) {
        return sentence;
      }
  
      int length = sentence.length();
      int separatorIndex = 0;
      char c = sentence.charAt(0);
      String separators;
      boolean includeSeparator;
      switch(c) {
      case '(':
        separators = ")";
        separatorIndex = 1;
        includeSeparator = true;
        break;
      case '{':
        separators = "}";
        separatorIndex = 1;
        includeSeparator = true;
        break;
      case '[':
        separators = "]";
        separatorIndex = 1;
        includeSeparator = true;
        break;
      case '<':
        separators = ">";
        separatorIndex = 1;
        includeSeparator = true;
        break;
      default:
        separators = SEPARATORS;
        includeSeparator = false;
      }
  
      outerloop: for(; separatorIndex < length; ++separatorIndex) {
        c = sentence.charAt(separatorIndex);
        if(c == '.') {
          int nextIndex = separatorIndex + 1;
          if(nextIndex == length) break;
          boolean ellipsis = false;
          while(sentence.charAt(nextIndex) == '.') { // ellipsis is part to the word, e.g. Object...
            if(++nextIndex == length) break outerloop;
            ellipsis = true;
            ++separatorIndex;
          }
          if(separators.indexOf(sentence.charAt(nextIndex)) != -1) {
            if(ellipsis) ++separatorIndex;
            break;
          }
          continue;
        }
        if(separators.indexOf(c) != -1) break;
      }
      if(includeSeparator) ++separatorIndex;
      return sentence.substring(0, separatorIndex);
    }