private static boolean withinTwo(INode n,INode goal){
  DoubleLinkedList<IMove> moves=n.validMoves();
  for (Iterator<IMove> it=moves.iterator(); it.hasNext(); ) {
    IMove move=it.next();
    INode successor=n.copy();
    move.execute(successor);
    if (withinOne(successor,goal)) {
      return true;
    }
  }
  return false;
}

private static boolean withinTwo ( INode n , INode goal ) { DoubleLinkedList < IMove > moves = n . validMoves ( ) ; for ( Iterator < IMove > it = moves . iterator ( ) ; it . hasNext ( ) ; ) { IMove move = it . next ( ) ; INode successor = n . copy ( ) ; move . execute ( successor ) ; if ( withinOne ( successor , goal ) ) { return true ; } } return false ; }
see if within two moves of solution .
