class 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()));
    }

}