### Question:
RentRollLine implements Importable { String keyToLeaseExternalReference() { return getKontraktNr() != null ? getKontraktNr().substring(2) : null; } RentRollLine(); String title(); LocalDate getInflyttningsDatumAsDate(); @Action(semantics = SemanticsOf.SAFE) List<ChargingLine> getChargingLines(); @PropertyLayout(hidden = Where.PARENTED_TABLES) Lease getLease(); @Action(semantics = SemanticsOf.NON_IDEMPOTENT, associateWith = "chargingLines", associateWithSequence = "1") RentRollLine apply(List<ChargingLine> lines); @Action(semantics = SemanticsOf.NON_IDEMPOTENT, associateWith = "chargingLines", associateWithSequence = "2") RentRollLine discard(List<ChargingLine> lines); @Override @Programmatic List<Object> importData(final Object previousRow);  }### Answer:
@Test public void keyToLeaseExternalReference_works_when_not_null() throws Exception { RentRollLine line = new RentRollLine(); line.setKontraktNr("351234-5678-01"); Assertions.assertThat(line.keyToLeaseExternalReference()).isEqualTo("1234-5678-01"); }
@Test public void keyToLeaseExternalReference_works_when_null() throws Exception { RentRollLine line = new RentRollLine(); Assertions.assertThat(line.keyToLeaseExternalReference()).isNull(); }