code: public static void adjustTileMatrixLengths(TileMatrixSet tileMatrixSet,
  			List<TileMatrix> tileMatrices) {
  		double tileMatrixWidth = tileMatrixSet.getMaxX()
  				- tileMatrixSet.getMinX();
  		double tileMatrixHeight = tileMatrixSet.getMaxY()
  				- tileMatrixSet.getMinY();
  		for (TileMatrix tileMatrix : tileMatrices) {
  			int tempMatrixWidth = (int) (tileMatrixWidth / (tileMatrix
  					.getPixelXSize() * tileMatrix.getTileWidth()));
  			int tempMatrixHeight = (int) (tileMatrixHeight / (tileMatrix
  					.getPixelYSize() * tileMatrix.getTileHeight()));
  			if (tempMatrixWidth > tileMatrix.getMatrixWidth()) {
  				tileMatrix.setMatrixWidth(tempMatrixWidth);
  			}
  			if (tempMatrixHeight > tileMatrix.getMatrixHeight()) {
  				tileMatrix.setMatrixHeight(tempMatrixHeight);
  			}
  		}
  	}
docs: Adjust the tile matrix lengths if needed. Check if the tile matrix width
  and height need to expand to account for pixel * number of pixels fitting
  into the tile matrix lengths
  
  @param tileMatrixSet
  tile matrix set
  @param tileMatrices
  tile matrices