public ArrayList<Move> whiteSafeMoves(ArrayList<Move> allWhiteMoves) {
        ArrayList<Move> rez = new ArrayList<Move>();

        for (Move currMove : allWhiteMoves) {
            int movedPiece = Utils.getMovedPieceFromMoveNumber(currMove.moveNumber);
            int to = Utils.getTargetPositionFromMoveNumber(currMove.moveNumber);

            // since black only has black king, white kings move is always safe
            if (movedPiece == 4) {
                // we get all pieces that could be eaten by black king
                ArrayList<Integer> piecesThatCantLooseProtection = this.piecesNearPosition(this.piecePosition[28]);
                boolean addKingMove = true;
                for (int piece : piecesThatCantLooseProtection) {
                    int positionOfPiece = this.piecePosition[piece];

                    // if some piece is protected by king, then king shouldn't
                    // withdraw protection
                    if (this.isPositionAdjacentToWhiteKing(positionOfPiece) && !ChessboardUtils.arePositionsAdjacent(positionOfPiece, to)) {
                        addKingMove = false;
                    }
                }
                if (addKingMove) {
                    rez.add(currMove);
                }
            }
            // if piece doesn't move near black king or is near white king, than
            // it's also safe move
            else if (!this.isPositionAdjacentToBlackKing(to) || this.isPositionAdjacentToWhiteKing(to)) {
                rez.add(currMove);
            }
        }
        return rez;
    }