public boolean startsWith(String word) {
        if (word == null || word.length() == 0)
            return false;

        int len = 0;
        TrieNode node = root;
        while (len < word.length()) {
            boolean found = false;
            for (int i = 0; i < node.nodes.size(); i++) {
                if (node.nodes.get(i).val.equals(String.valueOf( word.charAt(len)))) {
                    node = node.nodes.get(i);
                    found = true;
                    break;
                }
            }
            if (!found) return false;

            len = len + 1;
        }

        return true;
    }