private boolean haveVisitedNodeAlready(Node node, Stack<Node> cycleDetectionStack) {
    """
	Determine if a node has already been visited already by checking the cycleDetectionStack
	for it's existence. This method is used -- rather than Stack.contains() -- because
	we want to ignore the Node's 'next' attribute when comparing for equality.
    """
    for (Node cycleNode : cycleDetectionStack) {
      if (equalNodes(node, cycleNode)) {
        return true;
      }
    }
    return false;
  }
private boolean haveVisitedNodeAlready(Node node, Stack<Node> cycleDetectionStack) {
    for (Node cycleNode : cycleDetectionStack) {
      if (equalNodes(node, cycleNode)) {
        return true;
      }
    }
    return false;
  }
private boolean haveVisitedNodeAlready ( Node node , Stack < Node > cycleDetectionStack ) { for ( Node cycleNode : cycleDetectionStack ) { if ( equalNodes ( node , cycleNode ) ) { return true ; } } return false ; }
Determine if a node has already been visited already by checking the cycleDetectionStack
for it's existence. This method is used -- rather than Stack.contains() -- because
we want to ignore the Node's 'next' attribute when comparing for equality.
Determine if a node has already been visited already by checking the cycleDetectionStack for it s existence . This method is used -- rather than Stack . contains () -- because we want to ignore the Node s next attribute when comparing for equality .