public boolean isWord(String word) { Letter thisLetter = root; while (word.length() > 0) { Character thisChar = word.charAt(0); word = word.substring(1); if (!thisLetter.hasChild(thisChar)) { return false; } else { thisLetter = thisLetter.getChild(thisChar); } } return thisLetter.isWord(); }