private boolean validate(SuffixNode root, char[] input, int index, int curr){
        if(root == null){
            System.out.println("Failed at " + curr + " for index " + index);
            return false;
        }
        
        if(root.index != -1){
            if(root.index != index){
                System.out.println("Index not same. Failed at " + curr + " for index " + index);
                return false;        
            }else{
                return true;
            }
        }
        if(curr >= input.length){
            System.out.println("Index not same. Failed at " + curr + " for index " + index);
            return false;        
        }
        
        SuffixNode node = root.child[input[curr]];
        if(node == null){
            System.out.println("Failed at " + curr + " for index " + index);
            return false;
        }
        int j = 0;
        for(int i=node.start ; i <= node.end.end; i++){
            if(input[curr+j] != input[i] ){
                System.out.println("Mismatch found " + input[curr+j] + " " + input[i]);
                return false;
            }
            j++;
        }
        curr += node.end.end - node.start + 1;
        return validate(node, input, index, curr);
    }
Do validation of the tree by comparing all suffixes and their index at leaf node.
src/com/interview/suffixprefix/SuffixTree.java