### Question:
ConsentEntity extends InstanceDependableEntity implements Authorisable { public boolean isNonReccuringAlreadyUsed() { return !recurringIndicator && usages.stream() .anyMatch(u -> u.getUsageDate().isBefore(LocalDate.now())); }  @PostLoad void consentPostLoad(); @PreUpdate void consentPreUpdate(); @PrePersist void consentPrePersist(); boolean isConfirmationExpired(long expirationPeriodMs); void addUsage(AisConsentUsage aisConsentUsage); boolean isWrongConsentData(); boolean isExpiredByDate(); boolean shouldConsentBeExpired(); boolean isNonReccuringAlreadyUsed(); boolean isOneAccessType(); @Override String getInternalRequestId(AuthorisationType authorisationType);  }### Answer:
@Test void isNonReccuringAlreadyUsed_shouldReturnFalse_recurringConsent() { ConsentEntity aisConsent = buildConsent(Collections.singletonList(PSU_DATA), TPP_INFO, true); boolean actual = aisConsent.isNonReccuringAlreadyUsed(); assertFalse(actual); }
@Test void isNonReccuringAlreadyUsed_shouldReturnFalse_nonRecurringWithoutOldUsages() { ConsentEntity aisConsent = buildConsent(Collections.singletonList(PSU_DATA), TPP_INFO, false); aisConsent.setUsages(Collections.singletonList(buildAisConsentUsage(LocalDate.now()))); boolean actual = aisConsent.isNonReccuringAlreadyUsed(); assertFalse(actual); }
@Test void isNonReccuringAlreadyUsed_shouldReturnTrue_nonRecurringWithOldUsages() { ConsentEntity aisConsent = buildConsent(Collections.singletonList(PSU_DATA), TPP_INFO, false); aisConsent.setUsages(Arrays.asList(buildAisConsentUsage(LocalDate.now()), buildAisConsentUsage(LocalDate.now().minusDays(1)))); boolean actual = aisConsent.isNonReccuringAlreadyUsed(); assertTrue(actual); }