The Game class
An instance of the Game class contains a Row holding the secret color values and also contains a Table. When there is a new guess the Game instance stores the guess into the Table and also sets the number of positions and colors matching the secret row.
package packt.java9.by.example.mastermind;
Â
public class Game {
Â
   final Table table;
   final private Row secretRow;
   boolean finished = false;
Â
   public Game(Table table, Color[] secret ) {
       this.table = table;
       this.secretRow = new Row(secret);
   }
Â
   public void addNewGuess(Row row) {
       if( isFinished()){
           throw new IllegalArgumentException(
                      "You can not guess on a finished game.");
       }
       final int positionMatch = secretRow.
                         nrMatchingPositions(row.positions);
       final int colorMatch = secretRow.
                         nrMatchingColors(row.positions);
       row.setMatch...