public boolean hasPositionInGrid(Position position)
    {
        String message = null;

        if (position == null)
            message = "Position must not be null. Position: " + position;

        // Test for a well formed position
        if (!position.isValid())
            message = "Position must not be valid. Position: " + position;

        // Check that both values of the coordinate are valid for this grid.
        int x = position.getX();
        int y = position.getY();

        if (x < 0 || x >= rowSize)
        {
            message = "X position must fall between 0-" + rowSize + ". " +
                    "Position: " + position;
        }

        if (y < 0 || y >= colSize)
        {
            message = "Y position must fall between 0-" + colSize + ". " +
                    "Position: " + position;
        }

        String gridKey = gridKeyForCoordinate(position.getCoordinate());

        if (gridKey == null)
            message = "Coordinate must not be null: " + position;

        if (!grid.keySet().contains(gridKey))
        {
            message = "Invalid coordinate. Position: " + position + "\n" +
                    "GridKey: " + gridKey + "\n";
        }


        if (message != null)
        {
            // System.out.println(message);
            return false;
        }

        return true;
    }