Datum extends Feld { @Override public boolean isValid() { if (this.isEmpty()) { return true; } if (!super.isValid()) { return false; } return this.hasValidDate(); } Datum(final Enum feldX);  Datum(final Enum feldX, final FeldInfo info);  Datum(final Bezeichner bezeichner, final int start);  Datum(final String name, final int start);  Datum(final String name, final String inhalt);  Datum(Bezeichner bezeichner, int length, int start);  Datum(final Bezeichner bezeichner, final FeldInfo info);  Datum(final String name, final int length, final int start, final String inhalt);  Datum();  Datum(final int start);  Datum(final int length, final int start);  Datum(final Datum other); void setInhalt(final Datum d); void setInhalt(final Date d); Date toDate(); static Datum heute(); @Override boolean isEmpty(); @Override boolean isValid(); @Override boolean isInvalid(); @Override List<ConstraintViolation> validate(); @Override String format(); @SuppressWarnings("squid:S2975") @Override Object clone();  }
@Test public void testIsValid() { Datum xmas = new Datum("Xmas", "24122009"); assertTrue(xmas + " should be a valid date", xmas.isValid()); assertEquals(0, xmas.validate().size()); }
@Test public void testValidateEmptyDatum() { Datum empty = new Datum(); assertTrue(empty + " should be valid", empty.isValid()); }