@Override
    public boolean equals(Object obj){
        if(!(obj instanceof  FailureTransition))
            return false;
        if(obj == this)
            return true;

        FailureTransition ft = (FailureTransition)obj;

        boolean sameState = true;
        for(Tree<PhraseData> state : ft.getState()){
            if(!currentStateContainsState(state))
                sameState = false;
        }
        if(ft.getState().size() != currentTreeState.size())
            sameState = false;

        boolean sameTransition = true;
        for(Tree<PhraseData> transition : ft.getTransition()){
            if(!this.transition.contains(transition))
                sameTransition = false;
        }
        if(ft.getTransition().size() != this.transition.size())
            sameTransition = false;

        return (sameState && sameTransition);
    }