docs: private boolean checkEdgeCount( SquareGrid grid ) {
  
  		int left = 0, right = grid.columns-1;
  		int top = 0, bottom = grid.rows-1;
  
  		for (int row = 0; row < grid.rows; row++) {
  			boolean skip = grid.get(row,0) == null;
  
  			for (int col = 0; col < grid.columns; col++) {
  				SquareNode n = grid.get(row,col);
  				if( skip ) {
  					if ( n != null )
  						return false;
  				} else {
  					boolean horizontalEdge =  col == left || col == right;
  					boolean verticalEdge =  row == top || row == bottom;
  
  					boolean outer = horizontalEdge || verticalEdge;
  					int connections = n.getNumberOfConnections();
  
  					if( outer ) {
  						if( horizontalEdge && verticalEdge ) {
  							if( connections != 1 )
  								return false;
  						} else if( connections != 2 )
  							return false;
  					} else {
  						if( connections != 4 )
  							return false;
  					}
  				}
  				skip = !skip;
  			}
  		}
  		return true;
  	}