@@ -0,0 +1,1725 @@
+package de.fesere.tictactoe.players;%0A%0Aimport de.fesere.tictactoe.Board;%0Aimport de.fesere.tictactoe.Marker;%0Aimport de.fesere.tictactoe.Move;%0Aimport de.fesere.tictactoe.board.ArrayBoard;%0A%0Aimport java.util.regex.Matcher;%0Aimport java.util.regex.Pattern;%0A%0Aimport static de.fesere.tictactoe.Marker.NONE;%0A%0Apublic class BoardBuilder %7B%0A%0A    private Board board = new ArrayBoard();%0A%0A    public BoardBuilder() %7B%0A    %7D%0A%0A    public BoardBuilder row1(String row) %7B%0A        Marker %5B%5D markers = getMarkerFromString(row);%0A        return applyMarkersOnRow(0, markers);%0A    %7D%0A%0A    private Marker%5B%5D getMarkerFromString(String row) %7B%0A        Pattern pattern = Pattern.compile(%22(%5C%5C%5B.?%5C%5C%5D)%22);%0A        Matcher m = pattern.matcher(row);%0A        Marker %5B%5D marker = new Marker%5B3%5D;%0A        for(int i = 0; i%3C3; i++) %7B%0A            m.find();%0A            marker%5Bi%5D =convertToMarker(m.group());%0A        %7D%0A        return marker;%0A%0A    %7D%0A%0A    private Marker convertToMarker(String group) %7B%0A        if(group.contains(%22X%22)) %7B%0A            return Marker.X;%0A        %7D%0A        if(group.contains(%22O%22)) %7B%0A            return Marker.O;%0A        %7D%0A        return NONE;%0A%0A    %7D%0A%0A%0A    private BoardBuilder applyMarkersOnRow(int row, Marker ... marker) %7B%0A        for(int i =0; i %3C 3; i++) %7B%0A            Move move = new Move(row, i);%0A            board = board.mark(move, marker%5Bi%5D);%0A        %7D%0A        return this;%0A    %7D%0A%0A    public BoardBuilder row2(String row) %7B%0A        Marker %5B%5D markers = getMarkerFromString(row);%0A        return applyMarkersOnRow(1, markers);%0A    %7D%0A%0A    public BoardBuilder row3(String row) %7B%0A        Marker %5B%5D markers = getMarkerFromString(row);%0A        return applyMarkersOnRow(2, markers);%0A    %7D%0A%0A    public Board build() %7B%0A        return board;%0A    %7D%0A%7D%0A

Add infrastructure to write readable tests using a "graphical" board