int newEnd = currentWord.getEnd() + (newWord.length() - currentWord.length());
if (currentWord == null) { throw new WordNotFoundException("No Words in current String"); }
  public void replace(String newWord) {    int newEnd = currentWord.getEnd() +                  (newWord.length() - currentWord.length());    StringBuffer sb = new StringBuffer(text.substring(0,                                                       currentWord.getStart()));    sb.append(newWord);    sb.append(text.substring(currentWord.getEnd()));    currentWord.setText(newWord);    text = sb.toString();  }