public boolean equals(Piece piece) {
        if (piece == null) {
            return false;
        } else if (piece.getClass().equals(getClass())) {
            if (
                    (piece.getPieceType() == null || piece.getPieceType().equals(pieceType)) &&
                            (piece.getPlayer() == null || piece.getPlayer().equals(player)) &&
                            (piece.getLastMoveId() == null || piece.getLastMoveId().equals(lastMoveId))
                    ) {
                return true;
            } else {
                return false;
            }
        } else {
            return false;
        }
    }