static boolean checkGridSize(List<List<NodeInfo>> grid ,
								 int clusterSize ) {
		int total = 0;
		int expected = grid.get(0).size();
		for (int i = 0; i < grid.size(); i++) {
			if( expected != grid.get(i).size() )
				return false;
			total += grid.get(i).size();
		}

		return total == clusterSize;
	}
static boolean checkGridSize ( List < List < NodeInfo > > grid , int clusterSize ) { int total = 0 ; int expected = grid . get ( 0 ) . size ( ) ; for ( int i = 0 ; i < grid . size ( ) ; i ++ ) { if ( expected != grid . get ( i ) . size ( ) ) return false ; total += grid . get ( i ) . size ( ) ; } return total == clusterSize ; }
Makes sure the found grid is the same size as the original cluster.  If it's not then.
not all the nodes were used.  All lists must have he same size too.