// Path: src/main/nyc/angus/wordgrid/solver/Grids.java
// public class Grids {
// 
// 	private Grids() {
// 		// Class should not be instantiated.
// 	}
// 
// 	/**
// 	 * Create a new grid, removing the specified grid elements, and dropping any characters above these elements down,
// 	 * so that the only empty (' ') characters are at the top of the grid. The latter operation is termed 'gravity',
// 	 * since the remaining letters fall down if there is nothing but space below them.
// 	 * 
// 	 * @param grid
// 	 *        The grid to be changed (a copy is made before alteration, so this isn't changed).
// 	 * @param positionsToRemove
// 	 *        The grid positions to remove.
// 	 * @return A new grid, with the specified grid positions removed, and gravity applied to the remaining elements.
// 	 */
// 	public static char[][] removeElementsAndApplyGravity(@Nonnull final char[][] grid, @Nonnull final Collection<Position> positionsToRemove) {
// 
// 		final char[][] newGrid = cloneGrid(grid);
// 
// 		clearSpecifiedPositions(newGrid, positionsToRemove);
// 
// 		applyGravity(newGrid);
// 
// 		return newGrid;
// 	}
// 
// 	/**
// 	 * Clear the specified positions in the grid, replacing the previous character with the ' ' character.
// 	 */
// 	private static void clearSpecifiedPositions(@Nonnull final char[][] grid, @Nonnull final Collection<Position> positionsToRemove) {
// 		for (final Position position : positionsToRemove) {
// 			grid[position.y][position.x] = ' ';
// 		}
// 	}
// 
// 	/**
// 	 * If there is an empty space (a ' ' char) beneath any item in the grid, drop the character down.
// 	 * <p>
// 	 * This operation leaves space only at the top of the grid.
// 	 * <p>
// 	 * The grid passed in to this operation is modified.
// 	 */
// 	private static void applyGravity(@Nonnull final char[][] newGrid) {
// 		for (int y = 0; y < newGrid.length; y++) {
// 			for (int x = 0; x < newGrid[0].length; x++) {
// 
// 				if (newGrid[y][x] == ' ') {
// 					char prev = ' ';
// 					for (int i = 0; i <= y; i++) {
// 						final char temp = newGrid[i][x];
// 						newGrid[i][x] = prev;
// 						prev = temp;
// 					}
// 				}
// 
// 			}
// 		}
// 	}
// 
// 	/**
// 	 * Clone the provided grid.
// 	 */
// 	private static char[][] cloneGrid(@Nonnull final char[][] original) {
// 		return Arrays.stream(original).map((final char[] row) -> row.clone()).toArray((final int length) -> new char[length][]);
// 	}
// 
// 	/**
// 	 * Convert all characters in the grid to their lower-case equivalent, returning the result in a new 2D array.
// 	 */
// 	public static char[][] toLowerCase(@Nonnull final char[][] caseSensitiveGrid) {
// 		Preconditions.checkNotNull(caseSensitiveGrid);
// 		Preconditions.checkArgument(caseSensitiveGrid.length > 0);
// 
// 		final char[][] lowerCaseGrid = new char[caseSensitiveGrid.length][caseSensitiveGrid[0].length];
// 
// 		for (int y = 0; y < lowerCaseGrid.length; y++) {
// 			for (int x = 0; x < lowerCaseGrid[0].length; x++) {
// 				lowerCaseGrid[y][x] = Character.toLowerCase(caseSensitiveGrid[y][x]);
// 			}
// 		}
// 
// 		return lowerCaseGrid;
// 	}
// }


import static org.junit.Assert.assertTrue;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Modifier;
import nyc.angus.wordgrid.solver.Grids;
import org.junit.Test;
/*
 * Copyright 2015, Angus Macdonald 
 */

package nyc.angus.wordgrid.test;





/**
 * Tests of the {@link Grids} class.
 */
public class GridsTests {

	@Test
	public void testConstructorIsPrivate() throws NoSuchMethodException, IllegalAccessException, InvocationTargetException,
			InstantiationException {
// Path: src/main/nyc/angus/wordgrid/solver/Grids.java
// public class Grids {
// 
// 	private Grids() {
// 		// Class should not be instantiated.
// 	}
// 
// 	/**
// 	 * Create a new grid, removing the specified grid elements, and dropping any characters above these elements down,
// 	 * so that the only empty (' ') characters are at the top of the grid. The latter operation is termed 'gravity',
// 	 * since the remaining letters fall down if there is nothing but space below them.
// 	 * 
// 	 * @param grid
// 	 *        The grid to be changed (a copy is made before alteration, so this isn't changed).
// 	 * @param positionsToRemove
// 	 *        The grid positions to remove.
// 	 * @return A new grid, with the specified grid positions removed, and gravity applied to the remaining elements.
// 	 */
// 	public static char[][] removeElementsAndApplyGravity(@Nonnull final char[][] grid, @Nonnull final Collection<Position> positionsToRemove) {
// 
// 		final char[][] newGrid = cloneGrid(grid);
// 
// 		clearSpecifiedPositions(newGrid, positionsToRemove);
// 
// 		applyGravity(newGrid);
// 
// 		return newGrid;
// 	}
// 
// 	/**
// 	 * Clear the specified positions in the grid, replacing the previous character with the ' ' character.
// 	 */
// 	private static void clearSpecifiedPositions(@Nonnull final char[][] grid, @Nonnull final Collection<Position> positionsToRemove) {
// 		for (final Position position : positionsToRemove) {
// 			grid[position.y][position.x] = ' ';
// 		}
// 	}
// 
// 	/**
// 	 * If there is an empty space (a ' ' char) beneath any item in the grid, drop the character down.
// 	 * <p>
// 	 * This operation leaves space only at the top of the grid.
// 	 * <p>
// 	 * The grid passed in to this operation is modified.
// 	 */
// 	private static void applyGravity(@Nonnull final char[][] newGrid) {
// 		for (int y = 0; y < newGrid.length; y++) {
// 			for (int x = 0; x < newGrid[0].length; x++) {
// 
// 				if (newGrid[y][x] == ' ') {
// 					char prev = ' ';
// 					for (int i = 0; i <= y; i++) {
// 						final char temp = newGrid[i][x];
// 						newGrid[i][x] = prev;
// 						prev = temp;
// 					}
// 				}
// 
// 			}
// 		}
// 	}
// 
// 	/**
// 	 * Clone the provided grid.
// 	 */
// 	private static char[][] cloneGrid(@Nonnull final char[][] original) {
// 		return Arrays.stream(original).map((final char[] row) -> row.clone()).toArray((final int length) -> new char[length][]);
// 	}
// 
// 	/**
// 	 * Convert all characters in the grid to their lower-case equivalent, returning the result in a new 2D array.
// 	 */
// 	public static char[][] toLowerCase(@Nonnull final char[][] caseSensitiveGrid) {
// 		Preconditions.checkNotNull(caseSensitiveGrid);
// 		Preconditions.checkArgument(caseSensitiveGrid.length > 0);
// 
// 		final char[][] lowerCaseGrid = new char[caseSensitiveGrid.length][caseSensitiveGrid[0].length];
// 
// 		for (int y = 0; y < lowerCaseGrid.length; y++) {
// 			for (int x = 0; x < lowerCaseGrid[0].length; x++) {
// 				lowerCaseGrid[y][x] = Character.toLowerCase(caseSensitiveGrid[y][x]);
// 			}
// 		}
// 
// 		return lowerCaseGrid;
// 	}
// }


// Path: src/test/nyc/angus/wordgrid/test/GridsTests.java
import static org.junit.Assert.assertTrue;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Modifier;
import nyc.angus.wordgrid.solver.Grids;
import org.junit.Test;

/*
 * Copyright 2015, Angus Macdonald 
 */

package nyc.angus.wordgrid.test;





/**
 * Tests of the {@link Grids} class.
 */
public class GridsTests {

	@Test
	public void testConstructorIsPrivate() throws NoSuchMethodException, IllegalAccessException, InvocationTargetException,
			InstantiationException {
		final Constructor<Grids> constructor = Grids.class.getDeclaredConstructor();