package com.github.rishihahs.wordsearchsolver.grid;

import java.awt.Point;
import java.util.ArrayList;
import java.util.List;

/**
 * 
 * Basic implementation of a grid
 * 
 */
public class BasicGrid implements Grid {

    private String[][] grid;
    public List<Point> markedPoints = new ArrayList<Point>();

    /**
     * Creates a new BasicGrid with the supplied grid
     * 
     * @param grid The puzzle grid
     */
    public BasicGrid(String[][] grid) {
        this.grid = grid;
    }

    public String getLetterAt(Point point) {
        return grid[point.y][point.x];
    }

    public void markLetterAt(Point point) {
        markedPoints.add(point);
    }

    public boolean isValidLetter(Point point) {
        int row = point.y;
        int col = point.x;

        if (row < 0 || row > grid.length - 1) {
            return false;
        }

        if (col < 0 || col > grid[row].length - 1) {
            return false;
        }

        return true;
    }

    public int getRows() {
        return grid.length;
    }

    public int getCols() {
        return grid[0].length;
    }

    /**
     * @return the grid
     */
    public String[][] getGrid() {
        return grid;
    }

    /**
     * @param grid
     *            the grid to set
     */
    public void setGrid(String[][] grid) {
        this.grid = grid;
    }

}

@@ -86,24 +86,22 @@
 va.util.
-ArrayLis
+HashSe
 t;%0Aimpor
@@ -112,19 +112,18 @@
 va.util.
-Lis
+Se
 t;%0A%0A/**%0A
@@ -248,17 +248,23 @@
    p
-ublic Lis
+rivate final Se
 t%3CPo
@@ -291,16 +291,14 @@
 new 
-ArrayLis
+HashSe
 t%3CPo
@@ -1232,26 +1232,8 @@
 grid
-%0A     *           
  the
@@ -1245,16 +1245,16 @@
  to set%0A
+
      */%0A
@@ -1288,32 +1288,32 @@
 ing%5B%5D%5B%5D grid) %7B%0A
-
         this.gri
@@ -1329,10 +1329,136 @@
 %0A    %7D%0A%0A
+    /**%0A     * @return the markedPoints%0A     */%0A    public Set%3CPoint%3E getMarkedPoints() %7B%0A        return markedPoints;%0A    %7D%0A%0A
 %7D%0A

Use proper structure