@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Node otherNode = (Node) obj;
	    if (edges.size() != otherNode.edges.size())
	    	return false;
	    
	    /*if (suffixLink == null) {
			if (otherNode.suffixLink != null)
				return false;
		} else if (suffixLink.hashCode() != otherNode.suffixLink.hashCode())
			return false;
	    */
	    if (leafIndex != otherNode.leafIndex)
	    	return false;
	    
	    for (Map.Entry<Tuple, Node> edge : edges.entrySet()) {
	        if (otherNode.edges.containsKey(edge.getKey())) {
	            boolean result = edge.getValue().equals(otherNode.edges.get(edge.getKey()));
	            if (!result)
	            	return false;
	        } else
	            return false;
	    }
	    return true;
	}