private boolean compare(WordNode a, WordNode b) {
    if (a.count != b.count || a.letter != b.letter) {
      return false;
    }
    for (int i = 0; i < 26; i++) {
      compare(a.subNodes[i], b.subNodes[i]);
    }
    return true;
  }