### Question:
Grid implements Entity { public boolean onGrid(int x, int y) { return x >= 0 && x < width && y >= 0 && y < height; } Grid(GameSession session, int width, int height); int getWidth(); int getHeight(); GameSession getSession(); void place(int x, int y, Tileable tileable); Tile get(int x, int y); boolean onGrid(int x, int y);  }### Answer:
@Test public void onGridInPointsTest() { Grid grid = new Grid(session, 3, 2); for (int x = 0; x < 3; x++) { for (int y = 0; y < 2; y++) { assertThat(grid.onGrid(x,y)).isTrue(); } } }
@Test public void onGridOutPointsTest() { Grid grid = new Grid(session, 3, 2); int x = -1; int y = -1; while (y < 2) { while (x < 4) { assertThat(grid.onGrid(x, y)).isFalse(); x++; } x = -1; y += 3; } x = -1; y = -1; while (x < 4) { while (y < 3) { assertThat(grid.onGrid(x, y)).isFalse(); y++; } y = -1; x += 4; } }