### Question:
ChargingLine implements Importable { @Action(semantics = SemanticsOf.NON_IDEMPOTENT) public ImportStatus apply() { if (!discardedOrAggregatedOrApplied()) { ImportStatus result = fastnetImportService.updateOrCreateItemAndTerm(this); if (result != null && getImportStatus() != ImportStatus.AGGREGATED) { setApplied(clockService.now()); setImportStatus(result); } return result; } else { return getImportStatus(); } } ChargingLine(); String title(); @PropertyLayout(hidden = Where.PARENTED_TABLES) Lease getLease(); LeaseItem getLeaseItem(); @Action(semantics = SemanticsOf.NON_IDEMPOTENT) ImportStatus apply(); boolean hideApply(); @Action(semantics = SemanticsOf.IDEMPOTENT) ChargingLine discard(); boolean hideDiscard(); @Action(semantics = SemanticsOf.IDEMPOTENT) ChargingLine noUpdate(); boolean hideNoUpdate(); @Programmatic List<Object> importChargingLine(final boolean nonDiscardedOnly); @Override @Programmatic List<Object> importData(final Object previousRow);  }### Answer:
@Test public void apply_discarded_works() throws Exception { ChargingLine line = new ChargingLine(); line.setApplied(new LocalDate()); line.setImportStatus(ImportStatus.LEASE_ITEM_CREATED); Assertions.assertThat(line.apply()).isEqualTo(ImportStatus.LEASE_ITEM_CREATED); }