### Question:
AuthorisationStatusChecker { public boolean isFinalised(PsuIdData psuDataFromRequest, List<Authorisation> authorisations, AuthorisationType authorisationType) { return authorisations .stream() .filter(auth -> psuDataFromRequest.contentEquals(auth.getPsuIdData())) .filter(auth -> auth.getAuthorisationType() == authorisationType) .anyMatch(auth -> EnumSet.of(ScaStatus.FINALISED, ScaStatus.EXEMPTED).contains(auth.getScaStatus())); }  boolean isFinalised(PsuIdData psuDataFromRequest, List<Authorisation> authorisations, AuthorisationType authorisationType);  }### Answer:
@Test void isFinalised() { authorisations.add(createAuthorisation(PSU_ID_DATA, AuthorisationType.PIS_CREATION, ScaStatus.RECEIVED)); assertFalse(checker.isFinalised(PSU_ID_DATA, authorisations, AuthorisationType.CONSENT)); authorisations.add(createAuthorisation(PSU_ID_DATA, AuthorisationType.CONSENT, ScaStatus.RECEIVED)); assertFalse(checker.isFinalised(PSU_ID_DATA, authorisations, AuthorisationType.CONSENT)); authorisations.add(createAuthorisation(PSU_ID_DATA, AuthorisationType.CONSENT, ScaStatus.FINALISED)); assertTrue(checker.isFinalised(PSU_ID_DATA, authorisations, AuthorisationType.CONSENT)); }
@Test void isFinalised_emptyList() { assertFalse(checker.isFinalised(PSU_ID_DATA, authorisations, AuthorisationType.CONSENT)); assertFalse(checker.isFinalised(PSU_ID_DATA, authorisations, AuthorisationType.PIS_CREATION)); assertFalse(checker.isFinalised(PSU_ID_DATA, authorisations, AuthorisationType.PIS_CANCELLATION)); }