@@ -0,0 +1,2225 @@
+public class CarBuilder %7B%0A   /**  * Sport car.    */%0A   private static final int SPORT_CAR = 1;%0A %0A /**%0A  * City car.%0A    */%0A   private static final int CITY_CAR = 2;%0A %0A   /**%0A  * Cabriolet.%0A    */%0A   private static final int CABRIOLET = 3;%0A %0A   /**%0A    * The type of the car.%0A    */%0A   private int carType;%0A  %0A    /**%0A     * True if the car has a trip computer.%0A     */%0A    private boolean hasTripComputer;%0A  %0A    /**%0A     * True if the car has a GPS.%0A     */%0A    private boolean hasGPS;%0A  %0A    /**%0A     * The number of seaters the car may have.%0A     */%0A    private int seaterNumber;%0A  %0A    /**%0A     * Construct and return the car.%0A     * @return a Car with the right options.%0A     */%0A  %0A public Car getResult() %7B%0A      return new Car((carType == CITY_CAR) ? %22A city car%22 : ((carType == SPORT_CAR) ? %22A sport car%22 : %22A cabriolet%22)%0A          + %22 with %22 + seaterNumber + %22 seaters%22%0A          + (hasTripComputer ? %22 with a trip computer%22 : %22%22)%0A          + (hasGPS ? %22 with a GPS%22 : %22%22)%0A          + %22.%22);%0A      %7D%0A  %0A    /**%0A     * Tell the builder the number of seaters.%0A     * @param number the number of seaters the car may have.%0A     */%0A  %0A    public void setSeaters(int number) %7B%0A      seaterNumber = number;%0A    %7D%0A%0A  /**%0A   * Make the builder remember that the car is a city car.%0A   */%0A  public void setCityCar() %7B%0A      carType = CITY_CAR;%0A    %7D%0A%0A  /**%0A   * Make the builder remember that the car is a cabriolet.%0A   */%0A  public void setCabriolet() %7B%0A      carType = CABRIOLET;%0A    %7D%0A%0A  /**%0A   * Make the builder remember that the car is a sport car.%0A   */%0A  public void setSportCar() %7B%0A      carType = SPORT_CAR;%0A    %7D%0A%0A  /**%0A   * Make the builder remember that the car has a trip computer.%0A   */%0A  public void setTripComputer() %7B%0A      hasTripComputer = true;%0A    %7D%0A%0A /**%0A   * Make the builder remember that the car has not a trip computer.%0A   */%0A  public void unsetTripComputer() %7B%0A      hasTripComputer = false;%0A    %7D%0A%0A  /**%0A   * Make the builder remember that the car has a global positioning system.%0A   */%0A  public void setGPS() %7B%0A      hasGPS = true;%0A     %7D%0A %0A   /**%0A    * Make the builder remember that the car has not a global positioning system.%0A    */%0A   public void unsetGPS() %7B%0A       hasGPS = false;%0A     %7D%0A %7D%0A

Create CarBuilder.java