code: protected boolean isEquivalentInTheSet(Node node, boolean direction, Set<Node> set)
  	{
  		for (Node eq : direction == UPWARD ? node.getUpperEquivalent() : node.getLowerEquivalent())
  		{
  			if (set.contains(eq)) return true;
  			boolean isIn = isEquivalentInTheSet(eq, direction, set);
  			if (isIn) return true;
  		}
  		return false;
  	}
docs: Checks if an equivalent of the given node is in the set.
  @param node Node to check equivalents
  @param direction Direction to go to get equivalents
  @param set Node set
  @return true if an equivalent is in the set