public static Piece getPieceFromChar(char in)
    throws IllegalArgumentException{
    
        Piece out = null;
        
        switch(in){
            case ChessConstants.KING_PIECE_CHAR:{
                out = Piece.KING;
                break;
            }
            case ChessConstants.QUEEN_PIECE_CHAR:{
                out = Piece.QUEEN;
                break;
            }
            case ChessConstants.BISHOP_PIECE_CHAR:{
                out = Piece.BISHOP;
                break;
            }
            case ChessConstants.KNIGHT_PIECE_CHAR:{
                out= Piece.KNIGHT;
                break;
            }
            case ChessConstants.ROOK_PIECE_CHAR:{
                out = Piece.ROOK;
                break;
            }
            default:{
                String errorMsg = "Unknow piece type char '"+in+"'";
                IllegalArgumentException exception;
                exception = new IllegalArgumentException(errorMsg);
                throw exception;
            }
        }
        
        return out;
    }