title: Should I keep an enum attribute when it has always the same value as a result of a new inheritance?
body: <p>I have these classes:</p>
  <pre><code>enum Brand {
      FORD, FERRARI, TESLA, RENAULT;
  }
  </code></pre>
  <pre><code>public class Car {
      Brand brand;
      String plate;
      ...
  }
  //getters and setters
  </code></pre>
  <p>Imagine that for some reason, I need to make Car a superclass for two new classes: CombustionCar and ElectricCar. One of the new requierements is that ElectricCar's brand attribute must be always TESLA value and not any of the other ones values.
  I've thougth some solutions:</p>
  <ol>
  <li>I could keep Brand attr on superclass Car, and make ElectricCar constructor to set TESLA brand. But this way could allow me to set a new Brand after creating the object</li>
  </ol>
  <pre><code>public class ElectricCar extends Car {
      public ElectricCar(...){
      super(Brand.TESLA, ...);
  }
  
  ElectricCar ec = new ElectricCar(...);
  ec.setBrand(Brand.FORD);
  </code></pre>
  <ol start="2">
  <li>I can take Brand attr out from superclass and set it on both subclasses, but setting it in ElectricCar as a class attribute with a final so anyone would be able to set a new value</li>
  </ol>
  <pre><code>public class ElectricCar extends Car {
      public static final Brand brand = Brand.TESLA;
      ...
  }
  public class CombustionCar extends Car {
      private Brand brand;
      ...
  }
  </code></pre>
  <ol start="3">
  <li>Avoid inheritance and use composition, but with this I wont be able to use, for example, a List which contain both:</li>
  </ol>
  <pre><code>public class ElectricCar {
      private Car car;
      private Brand brand = Brand.TESLA;//with no setter
      ...
  }
  public class CombustionCar {
      private Car car;
      private Brand brand;
      ...
  }
  </code></pre>
  <p>I'm asking for the most elegant and manteinable solution, I think any of them would be nice to resolve my problem.</p>