public boolean check(byte[][] field, int lastX, int lastY, int sizeToWin) {
        if (field == null) {
            throw new NullPointerException("Field cannot be null.");
        }
        if (lastX <= 0 || lastY <= 0 || sizeToWin <= 0) {
            throw new IllegalArgumentException("LastX, lastY and sizeToWin should be positive.");
        }
        byte val = field[lastX][lastY];
        if (val == 0) {
            throw new IllegalArgumentException("The move was not made!");
        }
        
        if (checkWinByDirection(field, lastX, lastY, sizeToWin, -1, -1) ||
            checkWinByDirection(field, lastX, lastY, sizeToWin,  0, -1) ||
            checkWinByDirection(field, lastX, lastY, sizeToWin,  1, -1) ||
            checkWinByDirection(field, lastX, lastY, sizeToWin, -1,  0)) {
            return true;
        }
        return false;
    }