### Question:
AccountReference { @JsonIgnore public Set<AccountReferenceType> getUsedAccountReferenceFields() { return Stream.of(AccountReferenceType.values()) .filter(type -> StringUtils.isNotBlank(type.getFieldValue(this))) .collect(Collectors.toSet()); } AccountReference(AccountReferenceType accountReferenceType, String accountReferenceValue, Currency currency);  AccountReference(AccountReferenceType accountReferenceType, String accountReferenceValue, Currency currency, String resourceId, String aspspAccountId); @JsonIgnore AccountReferenceType getAccountReferenceType(); @JsonIgnore AccountReferenceSelector getUsedAccountReferenceSelector(); @JsonIgnore Set<AccountReferenceType> getUsedAccountReferenceFields(); @JsonIgnore boolean isNotCardAccount(); @JsonIgnore boolean isNotIbanAccount();  }### Answer:
@Test void getUsedAccountReferenceFields() { assertTrue(accountReference.getUsedAccountReferenceFields().isEmpty()); accountReference.setMaskedPan("masked pan"); assertTrue(accountReference.getUsedAccountReferenceFields().contains(AccountReferenceType.MASKED_PAN)); accountReference.setMsisdn("msisdn"); assertTrue(accountReference.getUsedAccountReferenceFields().contains(AccountReferenceType.MSISDN)); accountReference.setPan("pan"); assertTrue(accountReference.getUsedAccountReferenceFields().contains(AccountReferenceType.PAN)); accountReference.setBban("bban"); assertTrue(accountReference.getUsedAccountReferenceFields().contains(AccountReferenceType.BBAN)); accountReference.setIban("iban"); assertTrue(accountReference.getUsedAccountReferenceFields().contains(AccountReferenceType.IBAN)); assertEquals(5, accountReference.getUsedAccountReferenceFields().size()); }