@Test public void canBeRegisteredAfterLimitDate() throws ParseException { Date dateAfterLimitDate = date("01/01/2012"); Date limitDate = date("01/01/2002"); Car car = new Car(dateAfterLimitDate, 1550); boolean isRegisteredAfter = car.isRegisteredAfter(limitDate); assertTrue(isRegisteredAfter); }
public boolean isRegisteredAfter(Date date) { return registrationDate.compareTo(date) >= 0; }
Car extends Vehicle { public boolean isRegisteredAfter(Date date) { return registrationDate.compareTo(date) >= 0; } }
Car extends Vehicle { public boolean isRegisteredAfter(Date date) { return registrationDate.compareTo(date) >= 0; } Car(Date registrationDate, int engineSize); }
Car extends Vehicle { public boolean isRegisteredAfter(Date date) { return registrationDate.compareTo(date) >= 0; } Car(Date registrationDate, int engineSize); boolean isRegisteredAfter(Date date); int getCO2(); @Override VEHICULE_TYPE getType(); }
Car extends Vehicle { public boolean isRegisteredAfter(Date date) { return registrationDate.compareTo(date) >= 0; } Car(Date registrationDate, int engineSize); boolean isRegisteredAfter(Date date); int getCO2(); @Override VEHICULE_TYPE getType();  }